Re: Apache 2.0.52 + Tomcat 5.0.28 + mod_jk

From: Brent (blaufenberg_at_ameritech.net)
Date: 12/15/04


Date: 15 Dec 2004 13:28:52 -0800

Status - success!

Thanks for everyone's help. (Now the next step is clustering...ugh..I
think the trick is matching the jvmRoute Engine attribute to the load
balancing worker defined in workers.properties...or something along
those lines??)

Couple of things I'd like to mention in case anyone else needs the
information (or I forget!):

server.xml (Should look more like this)
---------------------------------------------------------------
<Server port="8005" shutdown="SHUTDOWN" debug="0">

<!--
Note I had to change the class from
org.apache.ajp.tomcat4.config.ApacheConfig to
org.apache.jk.config.ApacheConfig because the install of Tomcat I have
does not include a jar file that contains the ApacheConfig class in
that package
-->
<Listener
className="org.apache.jk.config.ApacheConfig"
forwardAll="false"
noRoot="false"
jkDebug="info"
jkWorker="localtomcat"
configHome="D:/Apache2/"
jkLog="D:/Apache2/logs/mod_jk.log"
modJk="D:/Apache2/modules/mod_jk.dll"
jkConfig="D:/Apache2/conf/mod_jk.conf"
workersConfig="D:/Apache2/conf/workers.properties"/>

<Service name="Catalina">

<!-- CONNECTOR FOR JK / AJP1.3 -->
<Connector port="8080"
enableLookups="false"
redirectPort="8443"
debug="0"
protocol="AJP/1.3"/>

<Engine
name="Standalone"
defaultHost="localhost"
debug="0"
jvmRoute="localtomcat">

<Host
name="localhost"
debug="0"
appBase="webapps"
unpackWARs="true"
autoDeploy="true"
xmlValidation="false"
xmlNamespaceAware="false">

<!--
Note I had to change the class from
org.apache.ajp.tomcat4.config.ApacheConfig to
org.apache.jk.config.ApacheConfig because the install of Tomcat I have
does not include a jar file that contains the ApacheConfig class in
that package
-->
<Listener
className="org.apache.jk.config.ApacheConfig"
forwardAll="false"
noRoot="false"
jkDebug="info"
jkWorker="localtomcat"
configHome="D:/Apache2/"
jkLog="D:/Apache2/logs/mod_jk.log"
modJk="D:/Apache2/modules/mod_jk.dll"
jkConfig="D:/Apache2/conf/mod_jk.conf"
workersConfig="D:/Apache2/conf/workers.properties"/>

</Host>
</Engine>
</Service>
</Server>

workers.properties (stayed the same)
---------------------------------------------------------------
worker.list=localtomcat
worker.localtomcat.type=ajp13
worker.localtomcat.host=localhost
worker.localtomcat.port=8080
worker.localtomcat.cachesize=50
worker.localtomcat.cache_timeout=600
worker.localtomcat.socket_keepalive=1
worker.localtomcat.reclycle_timeout=300

httpd.conf (copied from auto-generated mod_jk.conf file from Tomcat)
to generate from Tomcat use:
.\startup.bat -jkconfg
---------------------------------------------------------------
<IfModule !mod_jk.c>
LoadModule jk_module "D:/Apache2/modules/mod_jk.dll"
</IfModule>

JkWorkersFile "D:/Apache2/conf/workers.properties"
JkLogFile "D:/Apache2/logs/mod_jk.log"

JkLogLevel debug

<VirtualHost localhost>
ServerName localhost

# localhost:/corpapps

######
# Static files
######
Alias /corpapps "D:/tomcat5/webapps/corpapps"

<Directory "D:/tomcat5/webapps/corpapps">
Options Indexes FollowSymLinks
DirectoryIndex index.jsp index.html index.htm
</Directory>

######
# Deny direct access to WEB-INF and META-INF
######
<Location "/corpapps/WEB-INF/*">
AllowOverride None
deny from all
</Location>

<Location "/corpapps/META-INF/*">
AllowOverride None
deny from all
</Location>

######
# Use Directory too. On Windows, Location doesn't work unless case
matches
######
<Directory "D:/tomcat5/webapps/corpapps/WEB-INF/">
AllowOverride None
deny from all
</Directory>

<Directory "D:/tomcat5/webapps/corpapps/META-INF/">
AllowOverride None
deny from all
</Directory>

JkMount /corpapps/UploadFeedServlet localtomcat
JkMount /corpapps/SetupServlet localtomcat
JkMount /corpapps/LoginServlet localtomcat
JkMount /corpapps/*.jspx localtomcat
JkMount /corpapps/PlacementPerformanceServlet localtomcat
JkMount /corpapps/*.jsp localtomcat
JkMount /corpapps/ReconcileServlet localtomcat
</VirtualHost>