tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "João Gil ACE-SC" <joaogil.ace...@edis.edp.pt>
Subject RE: Unable to integrate Apache 2.0.24, mod_jk2 with Tomcat 5.
Date Tue, 07 Sep 2004 08:47:00 GMT


Thank's Andy for your help. Everything is working fine now.

Warmest regards
Joao Gil



                                                                                         
                                             
                      "Andy Eastham"                                                     
                                             
                      <andy@peakdrive.c        To:       "'Tomcat Users List'" <tomcat-user@jakarta.apache.org>
                       
                      om>                      cc:                                    
                                                
                                               Subject:  RE: Unable to integrate Apache 2.0.24,
mod_jk2 with Tomcat 5.                 
                      03-09-2004 14:45                                                   
                                             
                      Please respond to                                                  
                                             
                      "Tomcat Users                                                      
                                             
                      List"                                                              
                                             
                                                                                         
                                             
                                                                                         
                                             




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'" <tomcat-user@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







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


Mime
View raw message