Integrate Tomcat with Apache


I use Apache2.2 and apache-tomcat-6.0.26, so here these steps:

1. download mod_jk, you can find the latest version here
2. edit Apache httpd.conf, add :

# Load mod_jk
#mod_jk-1.2.30-httpd-2.2.3.so
LoadModule jk_module D:/oss/Apache2.2/modules/mod_jk.so

# Configure mod_jk
#
#JkWorkersFile D:/oss/apache-tomcat-6.0.26/conf/jk/workers.properties
#JkLogFile logs/mod_jk.log
#JkLogLevel info

JkLogStampFormat “[%a %b %d %H:%M:%S %Y] ”
JkMount /*.jsp ajp13

#To be added at the end of your httpd.conf
#For using Tomcat auto-configure
Include D:/oss/apache-tomcat-6.0.26/conf/auto/mod_jk.conf

3. create file “workers.properties” to [TOMCAT_HOME]/conf

worker.list=ajp13w,wlb,jkstatus

#
# Defining a worker named ajp13w and of type ajp13
# Note that the name and the type do not have to match.
#
worker.ajp13w.type=ajp13
worker.ajp13w.host=localhost
worker.ajp13w.port=8009

#
# Defining a load balancer
#

worker.wlb.type=lb
worker.wlb.balance_workers=ajp13w

#
# Define status worker
#

worker.jkstatus.type=status

note:
– replace [TOMCAT_HOME] & [JAVA_HOME] to your local path

– for Apache 2, you don’t need AddModule mod_jk.c

– other related tips, click integrate tomcat with apache

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: