How do I connect Apache to Tomcat using the mod_jk module?
Author: Deron Eriksson
Description: This tutorial describes how to connect the Apache Web Server to Tomcat using the mod_jk module.
Tutorial created using: Windows XP || JDK 1.5.0_09 || Eclipse Web Tools Platform 1.5.4 || Tomcat 5.5.20 || Apache HTTP Server 2.2.4

Page:    1 2 >

It's quite easy to connect ApacheSW to TomcatSW using the mod_jk module. To begin with, let's set up Tomcat. In Tomcat's server.xml file, uncomment the AJP connector, as shown below.

	<Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />

I'm going to run my 'tomcat-demo' project in EclipseSW, so my server.xml file has a Context entry for 'tomcat-demo'.

	<Context docBase="C:\projects\workspace\tomcat-demo\web" path="/tomcat-demo" reloadable="true"/>

Next, I'll start up my 'tomcat-demo' project in Eclipse using a Tomcat bootstrap debug configuration (for details on how to do this, please see my other tutorials):

starting tomcat-demo project in Eclipse

In the console, when we start fire up the Tomcat bootstrap debug configuration, we can see that the AJP13 listener is listening on port 8009.

May 25, 2007 11:25:02 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /
May 25, 2007 11:25:02 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31  config=null

The Apache web server doesn't come with the mod_jk connector by default, so let's download it. I downloaded the mod_jk Tomcat connector from For this tutorial, I downloaded from /pub/apache/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.23/.

I placed in my C:\Apache2.2.4\modules\ directory.

Apache modules directory

Next, I created a file in C:\Apache2.2.4\conf\, as shown below:


(Continued on page 2)

Page:    1 2 >