Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Feb 2008 16:42:12 +0100
From:      tequnix@frogmi.net
To:        freebsd-questions@freebsd.org
Subject:   Re: Configuring mod_jk for Apache and Tomcat
Message-ID:  <20080219164212.3e6e6fdf@jadzia.intern.creative.co.at>
In-Reply-To: <1203395615.6470.45.camel@laptop2.herveybayaustralia.com.au>
References:  <1203382458.6470.32.camel@laptop2.herveybayaustralia.com.au> <1203383232.5883.2.camel@pclmills> <1203386041.6470.36.camel@laptop2.herveybayaustralia.com.au> <1203388082.5883.6.camel@pclmills> <1203395615.6470.45.camel@laptop2.herveybayaustralia.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
Am Tue, 19 Feb 2008 14:33:35 +1000
schrieb Da Rock <rock_on_the_web@comcen.com.au>:


> OK. Tomcat is working- I managed to find out how to get direct access to
> it (had to uncomment a line in server.xml, web.xml). Still  no Apache /
> Tomcat connector though. If I navigate to /webapps it says 404 -
> although this says the error comes from Apache Tomcat6. Is it the
> connector config I need to play with or the Tomcat? In either case, what
> do I need to change?
> 
> I found through a search that older versions of Tomcat need to have a
> listener line in the server.xml. Is this true for Tomcat6?

There are two separate things to do:
 * configure the connector in tomcats server.xml
 * make apache aware of tomcats contexts (how this needs to be done
depends on which connector you use)

here is the relevant snippet from my server.xml (works with tomcat6
and tomcat5.*):
[..]
  <Service name="Tomcat-Apache">
  
   <Connector address="127.0.0.1" redirectPort="8009" protocol="AJP/1.3" enableLookups="true" debug="1"/>         
    <Engine name="Apache" defaultHost="localhost" debug="3">
                        
    <Host name="localhost" debug="0" appBase="webapps">
    
      <Alias>somename</Alias>
      
      <Context path="/a_wepapp" reloadable="true" 
               docBase="/path/to/that/webapp" />      
           
    </Host>
    </Engine>
  </Service>
[..]


for the httpd.conf and with mod_jk you need something like that:
[..]
JkMount /a_wepapp/* ajp13
[..]

(if you have mappings in your web.xml. if you want to use the
"invoker" servlet and skip mappings in your web.xml, you may remove the
comments around that part in the tomcat/config/web.xml and use
JkMount /a_wepapp/servlet/* ajp13
instead)

some time ago i switched from mod_jk to apaches proxy_ajp modul (as i
find it easier to maintain), the part for the httpd.conf would look like:

[..]
LoadModule proxy_ajp_module   libexec/apache22/mod_proxy_ajp.so

ProxyPass /a_wepapp       ajp://127.0.0.1:8009/a_wepapp
[..]


HTH,
reinhard



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080219164212.3e6e6fdf>