Having confirmed that accessing Tomcat directly works all that is left now is to configure mod_jk to facilitate accessing files served by Tomcat via your normal port 80 webroot as served up by Apache.

RedHat Apache configuration has a directory for custom configuration files in /etc/httpd/conf.d we will add the mod_jk config there in a seperate file called mod_jk.conf

LoadModule jk_module modules/mod_jk.so

JkWorkersFile /etc/tomcat5/jk/workers.properties
JkLogFile /var/log/tomcat5/mod_jk.log
JkLogLevel error
JkMount /jsp-examples/* ajp13

Create a directory for the mod_jk properties file in /etc/tomcat5/jk and put the following in a file called workers.properties in that directory. Using this file you can change location of the log files and the log level later on. Full details on the commands available in this file can be found in the Tomcat Documentation

workers.tomcat_home=/usr/share/tomcat5
workers.java_home=/usr/lib/jvm/java
ps=/
worker.list=ajp13

worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.cache_timeout=15
worker.inprocess.type=jni

Restart Apache using the command:

# service httpd restart

You should now be able to access the Tomcat examples through Apache as http://localhost/jsp-examples/ it should act the same as http://localhost:8080/jsp-examples/

RedHat/Java/mod jk (last edited 2006-11-12 11:31:38 by nat)