HomepageVisit my blogCurriculumRoboticsFirefox Extensionsweb serverWebsites that I madePhotos
Tomcat 4.x
Apache + Tomcat
Connecting Apache 2.0 and Tomcat 4.x

I suppose you have installed Apache 2.0, Tomcat 4.x and you want to connect them together. So you have to download the source code of JK2 connector from the Apache Jakarta Project download page. In this page you have to go to the section named "Tomcat Web Server Connectors" and you have to click on the link about JK 2. When you have downloaded it you have to follow the instructions about the building process (read the readme file into the archive you have downloaded).

Now you have to copy the DSO files in the Apache modules location; to do this follows this simple steps:

  • cd $TOMCAT_CONNECTORS_SOURCE
  • cp jk/build/jk2/apache2/mod_jk2.so $APACHE_HOME/modules
  • cp jk/build/jk2/apache2/jkjni.so $APACHE_HOME/modules

where $TOMCAT_CONNECTORS_SOURCE is the directory where you have the source code of the Tomcat connectors.

The last thing which remains to be done is configuring Apache to use JK2 module to communicate with Tomcat.
To do this you have to change the configuration file of Apache (httpd.conf) adding this line inside the "DSO Support" section:

LoadModule jk2_module modules/mod_jk2.so

You have not finished yet because you have to create a file named "workers2.properties" into the "$APACHE_HOME/conf" directory. This file must contain at least this things:

# 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=Map the whole webapp

This worker2.properties file is only an example; if you need more information you can read the official documentation from Apache web site.

The last thing you have to do is starting the Tomcat and Apache web server and browse to the http://localhost/examples/.

You can feel free to send me an email to ask me something, ok?