Site hosted by Angelfire.com: 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

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

<CATALINA_HOME>/bin/startup.sh

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

./buildconf.sh

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

make

cd ../build/jk2/apache2

/usr/local/apache2/bin/apxs -n jk2 -i mod_jk2.so

#check if mod_jk2.so 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 workers2.properties and paste the

# following:

# Define the communication channel

[channel.socket:localhost:8009]

info=Ajp13 forwarding over socket

tomcatId=localhost:8009

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

[uri:/examples/*]

info=Examples

      #Edit Http.conf

# Add this as last line of httpd.conf

LoadModule jk2_module modules/mod_jk2.so

# 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