eXTReMe Tracker

Linux Tomcat Apache and mod_jk-HOWTO

Prev Next Home


3. Configuring the Software

3.1 Configuring workers.properties

Edit the workers.properties file in $CATALINA_HOME/conf/ If you followed my installation instructions for Tomcat at http://members.cox.net/midian/howto/flex+tomcat.htm it should be /usr/java/tomcat/conf/workers.properties

Update the entries for workers.tomcat_home and workers.java_home

workers.tomcat_home=/usr/java/tomcat
workers.java_home=/usr/java/jdk1.5.0_04

Change the worker.list from ajp12, ajp13 to just ajp13, or ajp13, inprocess if you want JNI connector. While running the JVM inside the web server gives the best performance, it lacks the stability of the out of process mode.

workers.list=ajp13

Comment out the worker.ajp12 entries if you want, it is not necessary.

Change worker.ajp13.host from localhost to your fully qualified domain name or IP address

worker.ajp13.host=[fully qualified domain name]

If you want to cache your connections, uncomment worker.ajp13.cachesize and add a value.

worker.ajp13.cachesize=20

Change worker.loadbalancer.balanced_workers from ajp12, ajp13 to just ajp13.

worker.loadbalancer.balanced_workers=ajp13

If all you need is a simple, straight-forward out of process configuration without load balancing, you can use this as your complete workers.properties file. Again remember to set the host with your fully qualified domain name or IP address

worker.list=ajp13
worker.ajp13.type=ajp13
worker.ajp13.host=[fully qualified domain name]
worker.ajp13.port=8009

3.2 Configure Tomcat

Edit the Tomcat server.xml file located in $CATALINA_HOME/conf/ If you followed my installation instructions for Tomcat at http://members.cox.net/midian/howto/flex+tomcat.htm it should be /usr/java/tomcat/conf/server.xml

Immediately below the entry <Server port="8005" shutdown="SHUTDOWN"> add:

<Listener className="org.apache.jk.config.ApacheConfig" modJk="/usr/lib/httpd/modules/mod_jk.so" workersConfig="/usr/java/tomcat/conf/workers.properties" jkLog="/usr/java/tomcat/logs/mod_jk.log" jkDebug="info" />

Find the entry <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> and change localhost to your fully qualified domain name or IP address.

<Host name="[fully qualified domain name]" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">

Immidiately following that line add:

<Listener className="org.apache.jk.config.ApacheConfig" append="true" jkWorker="ajp13" />

Restart Tomcat and verify that $CATALINA_HOME/conf/auto/mod_jk.conf is created. If you followed my installation instructions for Tomcat at http://members.cox.net/midian/howto/flex+tomcat.htm it should be /usr/java/tomcat/conf/auto/mod_jk.conf

By configuring Tomcat to create and recreate the mod_jk.conf on startup, it will automatically add a JkMount for any new webapps you deploy.

3.3 Configuring Apache

Edit /etc/httpd/conf/httpd.conf and after the last LoadModule entry add an Include for the mod_jk.conf:

Include "/usr/java/tomcat/conf/auto/mod_jk.conf"

Restart Apache

Browse to http://localhost/jsp-examples/ or any other webapp you have installed in Tomcat and Apache should send it to Tomcat.


Next
Tomcat Apache and mod_jk
Prev
Installing Software

Home