You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by João Gil ACE-SC <jo...@edis.edp.pt> on 2004/09/03 13:18:27 UTC

RE: Unable to integrate Apache 2.0.24, mod_jk2 with Tomcat 5.

Hello,

Thank's to Andy Eastham solution I managed to get Apache to forward *.jsp
requests to Tomcat. In adition I also discovered
that I had to define "localhost"(127.0.0.1) in JK2.properties file as
without this config Tomcat(JK2) was listening on the wrong
IP(0.0.0.0.).

Servlets are still not being forwarded - Apache reports - "404 file not
found" when I click on, for example, - http://localhost/MyServlet.
MyServlet exists on my root_path as MyServlet.class . Can anyone tell me
how to prevent this error and forward the request to
Tomcat5?

Warmest Regards
Joao Gil



                                                                                                                                       
                      "Andy Eastham"                                                                                                   
                      <andy@peakdrive.c        To:       "'Tomcat Users List'" <to...@jakarta.apache.org>                        
                      om>                      cc:                                                                                     
                                               Subject:  RE: Unable to integrate Apache 2.0.24 with Tomcat 5.                          
                      02-09-2004 16:41                                                                                                 
                      Please respond to                                                                                                
                      "Tomcat Users                                                                                                    
                      List"                                                                                                            
                                                                                                                                       
                                                                                                                                       




Joao,

I looked at that url and the way redirections are configured is different
to
mine.

I do NOT have things like
<Location "/*.jsp">
JkUriSet worker ajp13:localhost:8009
</Location>

<Location "/mywebapp">
JkUriSet worker ajp13:localhost:8009
</Location>

(in fact these look like mod_jk configuration to me)

Instead, my workers2.properties is as follows:
[logger.apache2]
#level=DEBUG

[shm]
file=/usr/local/apache2/logs/shm.file
size=1048576

# Example socket channel, override port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1

# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

# Uri mapping
[uri:192.168.0.103/wisadmin/*]
worker=ajp13:localhost:8009

[uri:localhost/wisadmin/*]
worker=ajp13:localhost:8009

[uri:wis/wisadmin/]
worker=ajp13:localhost:8009

[uri:127.0.0.1/wisadmin/*]
worker=ajp13:localhost:8009

Note that the URIs are mapped in this file.

Give this a try,

Andy

> -----Original Message-----
> From: João Gil ACE-SC [mailto:joaogil.ace-sc@edis.edp.pt]
> Sent: 02 September 2004 16:25
> To: tomcat-user@jakarta.apache.org
> Subject: Unable to integrate Apache 2.0.24 with Tomcat 5.
>
>
> Greatings,
>
> I am trying to integrate Apache 2.0.24 with Tomcat 5 with no success.
>
> The best solution I have found on the net is at
> http://www.dynamicobjects.com/d2r/archives/002574.html
>
> After configuring Apache and Tomcat as instructed, both execute with
> no problem. But Apache is still not forwarding JSP pages/Servlets
> to Tomcat. Can anyone help me?
>
> Warmest Regards
> Joao Gil
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org







---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


AW: Unable to integrate Apache 2.0.24, mod_jk2 with Tomcat 5.

Posted by SH Solutions <sh...@gmx.net>.
Hi

> Servlets are still not being forwarded - Apache reports - "404 file 
> not
found" when I click on, for example, - http://localhost/MyServlet.
MyServlet exists on my root_path as MyServlet.class . Can anyone tell me how
to prevent this error and forward the request to Tomcat5?

First, simply copying Java Classes to root_path does not work.
Servlets need to be
1. inside WEB-INF
2. NOT packageless
3. mapped in web.xml

Try to get tomcat with it's own html-connector to work first.
It is much easier than with apache / mod_jk.

THEN think about using tomcat without apache.
And only LAST, put mod_jk inbetween.
In that case, think about updateing your fairly old version of Apache2.
2.0.50 is current stable. 2.0.24 is old and has much more bugs. There should
be no problems, since the apache2 api is stable since 2.0.22.

Regards,
  Steffen


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


AW: Unable to integrate Apache 2.0.24, mod_jk2 with Tomcat 5.

Posted by Gunnar Pörschke <gp...@canto.de>.
Change settings of your workers file... Maybe tomcat does not use it???
 

-----Ursprüngliche Nachricht-----
Von: João Gil ACE-SC [mailto:joaogil.ace-sc@edis.edp.pt] 
Gesendet: Freitag, 3. September 2004 13:18
An: Tomcat Users List
Betreff: RE: Unable to integrate Apache 2.0.24, mod_jk2 with Tomcat 5.


Hello,

Thank's to Andy Eastham solution I managed to get Apache to forward *.jsp
requests to Tomcat. In adition I also discovered that I had to define
"localhost"(127.0.0.1) in JK2.properties file as without this config
Tomcat(JK2) was listening on the wrong IP(0.0.0.0.).

Servlets are still not being forwarded - Apache reports - "404 file not
found" when I click on, for example, - http://localhost/MyServlet.
MyServlet exists on my root_path as MyServlet.class . Can anyone tell me how
to prevent this error and forward the request to Tomcat5?

Warmest Regards
Joao Gil



 

                      "Andy Eastham"

                      <andy@peakdrive.c        To:       "'Tomcat Users
List'" <to...@jakarta.apache.org>                        
                      om>                      cc:

                                               Subject:  RE: Unable to
integrate Apache 2.0.24 with Tomcat 5.                          
                      02-09-2004 16:41

                      Please respond to

                      "Tomcat Users

                      List"

 

 





Joao,

I looked at that url and the way redirections are configured is different to
mine.

I do NOT have things like
<Location "/*.jsp">
JkUriSet worker ajp13:localhost:8009
</Location>

<Location "/mywebapp">
JkUriSet worker ajp13:localhost:8009
</Location>

(in fact these look like mod_jk configuration to me)

Instead, my workers2.properties is as follows:
[logger.apache2]
#level=DEBUG

[shm]
file=/usr/local/apache2/logs/shm.file
size=1048576

# Example socket channel, override port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1

# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

# Uri mapping
[uri:192.168.0.103/wisadmin/*]
worker=ajp13:localhost:8009

[uri:localhost/wisadmin/*]
worker=ajp13:localhost:8009

[uri:wis/wisadmin/]
worker=ajp13:localhost:8009

[uri:127.0.0.1/wisadmin/*]
worker=ajp13:localhost:8009

Note that the URIs are mapped in this file.

Give this a try,

Andy

> -----Original Message-----
> From: João Gil ACE-SC [mailto:joaogil.ace-sc@edis.edp.pt]
> Sent: 02 September 2004 16:25
> To: tomcat-user@jakarta.apache.org
> Subject: Unable to integrate Apache 2.0.24 with Tomcat 5.
>
>
> Greatings,
>
> I am trying to integrate Apache 2.0.24 with Tomcat 5 with no success.
>
> The best solution I have found on the net is at 
> http://www.dynamicobjects.com/d2r/archives/002574.html
>
> After configuring Apache and Tomcat as instructed, both execute with 
> no problem. But Apache is still not forwarding JSP pages/Servlets to 
> Tomcat. Can anyone help me?
>
> Warmest Regards
> Joao Gil
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org







---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Unable to integrate Apache 2.0.24, mod_jk2 with Tomcat 5.

Posted by Andy Eastham <an...@peakdrive.com>.
Joao,

The way I do this is to forward all of a subdirectories requests to a webapp
on tomcat, and then I give my servlets an arbitrary extension (I use .isa
for irrelevant reasons).

For example, in workers2.properties, I forward everything to the apache url
/control to tomcat:
[uri:localhost/control/*]
worker=ajp13:localhost:8009

[uri:wwws/control/]
worker=ajp13:localhost:8009

[uri:127.0.0.1/control/*]
worker=ajp13:localhost:8009

Then in tomcats server.xml:
 <Host name="xxx.xx.xxx.xx.xx" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">
                                 <Alias>www.xxx.com</Alias>
                                 <Alias>192.168.0.102</Alias>
                                 <Alias>localhost</Alias>
                                 <Alias>wwws</Alias>
                                 <Alias>127.0.0.1</Alias>


                                 <Context path="control" docBase=""
debug="1"/>

                                 <Valve
className="org.apache.catalina.valves.AccessLogValve"
                 directory="logs"  prefix="home_access_log." suffix=".txt"
                 pattern="common" resolveHosts="false"/>
</Host>

Note the context path for "control", and the aliases for different urls your
server may be called by.

Then in the web.xml for the control webapp (under WEB-INF directory):
    <servlet>
        <servlet-name>
            myServlet
        </servlet-name>
        <servlet-class>
            com.xxxx.servlet.myServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>


    <servlet-mapping>
        <servlet-name>
            myServlet
        </servlet-name>
        <url-pattern>
            *.isa
        </url-pattern>
    </servlet-mapping>

This maps any requests to anything.isa to my servlet.

If you don't want to use the extension method, you can use the "invoker"
servlet supplied with Tomcat.

This method requires that you redirect a subdirectory, not all apache
requests.  I don't know if you can redirect all apache requests, but that
would lose some of the benefits of using apache with tomcat, eg serving
images and other static content directly from apache.

Hope this helps,

Andy



> -----Original Message-----
> From: João Gil ACE-SC [mailto:joaogil.ace-sc@edis.edp.pt]
> Sent: 03 September 2004 12:18
> To: Tomcat Users List
> Subject: RE: Unable to integrate Apache 2.0.24, mod_jk2 with Tomcat 5.
> 
> 
> Hello,
> 
> Thank's to Andy Eastham solution I managed to get Apache to forward *.jsp
> requests to Tomcat. In adition I also discovered
> that I had to define "localhost"(127.0.0.1) in JK2.properties file as
> without this config Tomcat(JK2) was listening on the wrong
> IP(0.0.0.0.).
> 
> Servlets are still not being forwarded - Apache reports - "404 file not
> found" when I click on, for example, - http://localhost/MyServlet.
> MyServlet exists on my root_path as MyServlet.class . Can anyone tell me
> how to prevent this error and forward the request to
> Tomcat5?
> 
> Warmest Regards
> Joao Gil
> 
> 
> 
> 
>                       "Andy Eastham"
>                       <andy@peakdrive.c        To:       "'Tomcat Users
> List'" <to...@jakarta.apache.org>
>                       om>                      cc:
>                                                Subject:  RE: Unable to
> integrate Apache 2.0.24 with Tomcat 5.
>                       02-09-2004 16:41
>                       Please respond to
>                       "Tomcat Users
>                       List"
> 
> 
> 
> 
> 
> 
> Joao,
> 
> I looked at that url and the way redirections are configured is different
> to
> mine.
> 
> I do NOT have things like
> <Location "/*.jsp">
> JkUriSet worker ajp13:localhost:8009
> </Location>
> 
> <Location "/mywebapp">
> JkUriSet worker ajp13:localhost:8009
> </Location>
> 
> (in fact these look like mod_jk configuration to me)
> 
> Instead, my workers2.properties is as follows:
> [logger.apache2]
> #level=DEBUG
> 
> [shm]
> file=/usr/local/apache2/logs/shm.file
> size=1048576
> 
> # Example socket channel, override port and host.
> [channel.socket:localhost:8009]
> port=8009
> host=127.0.0.1
> 
> # define the worker
> [ajp13:localhost:8009]
> channel=channel.socket:localhost:8009
> 
> # Uri mapping
> [uri:192.168.0.103/wisadmin/*]
> worker=ajp13:localhost:8009
> 
> [uri:localhost/wisadmin/*]
> worker=ajp13:localhost:8009
> 
> [uri:wis/wisadmin/]
> worker=ajp13:localhost:8009
> 
> [uri:127.0.0.1/wisadmin/*]
> worker=ajp13:localhost:8009
> 
> Note that the URIs are mapped in this file.
> 
> Give this a try,
> 
> Andy
> 
> > -----Original Message-----
> > From: João Gil ACE-SC [mailto:joaogil.ace-sc@edis.edp.pt]
> > Sent: 02 September 2004 16:25
> > To: tomcat-user@jakarta.apache.org
> > Subject: Unable to integrate Apache 2.0.24 with Tomcat 5.
> >
> >
> > Greatings,
> >
> > I am trying to integrate Apache 2.0.24 with Tomcat 5 with no success.
> >
> > The best solution I have found on the net is at
> > http://www.dynamicobjects.com/d2r/archives/002574.html
> >
> > After configuring Apache and Tomcat as instructed, both execute with
> > no problem. But Apache is still not forwarding JSP pages/Servlets
> > to Tomcat. Can anyone help me?
> >
> > Warmest Regards
> > Joao Gil
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org