Apache 2.0.39 and Tomcat 4.0.4 configuration instructions:
NOTE: Avoid empty spaces in your installation directory names!!!
Do not place anything under Program Files/Apache Group...etc.
If you have already installed Tomcat and Apache in folders with spaces, after renaming the folders,
execute regedit and change all the file paths for Apache and Tomcat. Simple reinstall will not work.
1. Install java standard edition, j2sdk1.4.0
a. set JAVA_HOME={j2sdk install dir}
b. add entry to Path variable %java_home%\bin
c. add new user variable classpath = %java_home%\bin
2. Install Apache and Tomcat.
a. set APACHE_HOME={Apache_dir}
b. set TOMCAT_HOME={Tomcat dir}
2. In tomcat_home/conf dir:
a. Modify server.xml file:
after the Server port="8005"..., add these lines :
<Listener className="org.apache.ajp.tomcat4.config.ApacheConfig" modJk="{apache_home}/modules/mod_jk.dll"
jkDebug="info" workersConfig="{tomcat_home}/conf/workers.properties" jkLog="{tomcat_home}/logs/mod_jk.log" />
b. Version 4.0.4 of Tomcat does not have a workers.properties file, so you may use the following
lines to put in you {tomcat_home}/conf directory as workers.properties file:
workers.tomcat_home={tomcat_home}\conf
workers.java_home=$(JAVA_HOME)
ps=
worker.list=ajp13, ajp14
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
worker.ajp14.port=8010
worker.ajp14.host=localhost
worker.ajp14.type=ajp14
worker.ajp14.secretkey=secret
worker.ajp14.credentials=myveryrandomentropy
worker.ajp14.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp13
worker.inprocess.type=jni
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar
worker.inprocess.cmd_line=start
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)jvm.dll
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr
3. You need the mod_jk.dll file, its available from
(Windows), make sure its the version for Apache2.
4. in {apache_home}/conf in httpd.conf file:
a. After the lines LoadModule...add this line:
Include {Tomcat_home}/conf/auto/mod_jk.conf
b. At the very bottom of this file, add the following lines:
JkWorkersFile "{tomcat_home}/conf/workers.properties"
JkLogFile "{tomcat_home}/logs/mod_jk.log"
JkLogLevel debug
JkMount /{your_webapp_here} ajp13
JkMount /{your_webapp_here}/* ajp13
JkMount /examples ajp13
JkMount /examples/* ajp13
JkMount /jk ajp13
JkMount /jk/* ajp13
JkMount /cocoon ajp13
JkMount /cocoon/* ajp13
5. Remember to start the Tomcat first, on port 8080(default). After its started, if all goes well, check the
{tomcat_home}/conf directory, it should contain auto folder (its automatically created at startup)
with mod_jk.conf file in it.
Start Apache.
Point your browser to
The index page for the examples should display.
Congratulations, You have successfully configured Apache to work with Tomcat through ajp13 connector!
check it out, it seems to work.
alex