Site hosted by Build your free website today!

Connecting Apache 2.0 and Tomcat 4.1x with mod_jk2

Outlined below are five easy steps to setup Apache 2.0 and Tomcat 4.1x servers and connecting the two with mod_jk2.

1.   Install Apache 2.0.

# extract httpd-2.0.50.tar.gz and cd to that directory

./configure --with-layout=Apache --prefix=/usr/local/apache2 --enable-module=most --enable-mods-shared=most



make install

2.   Install Tomcat 4.x. (assumed already running).

#Download Tomcat 4.1x

#unzip/untar the download file and placing in the desired directory

#start the server


3.   Install tomcat connector.

#extract jakarta-tomcat-connectors-4.0.5-src.tar.gz

cd jakarta-tomcat-connectors-jk2-2.0.4-src/jk/native2


./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-EAPI


cd ../build/jk2/apache2

/usr/local/apache2/bin/apxs -n jk2 -i

#check if is now present under /usr/local/apache2/modules

4.   Configure Tomcat for Apache 2.0.

# If you are using Tomcat 4.1x, its already done!!!

5.   Configure Apache2 for Tomcat

# under /usr/local/apache2/conf create and paste the

# following:

# Define the communication channel


info=Ajp13 forwarding over socket


# Map the Tomcat examples webapp to the Web server uri space



      #Edit Http.conf

# Add this as last line of httpd.conf

LoadModule jk2_module modules/

# and stop/start Apache.

6.   Remove optional Tomcat Listeners.

# If you do not want Tomcat to run in standalone mode, remove all <Listeners> other than 8009 in server.xml under <CATALINA_HOME>/conf

        NOTE: After connection and testing, if the Tomcat server is restarted, then the Apache server should also be restarted.

Authored by Balamurugan S