Configuring Apache 2 and Tomcat 5.5 with mod_jk

A configuration nightmare simplified....

1 : Download the from here .
2 : Rename the downloaded .so file to and copy it to
/modules folder :
Usually on Windows :C:\Program Files\Apache Group\Apache\modules Linux :/usr/lib/apache/
3 : Open the httpd.conf from your /conf directory
and put the following lines just after the last 'LoadModule' entry.
# Load mod_jk module
# Update this path to match your modules location
LoadModule jk_module "C:/Program Files/Apache
# Declare the module for (remove this line on Apache 2.x)
# AddModule mod_jk.c (Gotcha : Remove this is you have Apache 2.x)
# Where to find
# Update this path to match your conf directory location (put
# next to httpd.conf)
JkWorkersFile "D:/Tomcat 5.5/conf/"
# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log next to
# access_log)
JkLogFile "D:/Tomcat 5.5/logs/mod_jk.log"
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# Send everything for context /examples to worker named worker1 (ajp13)
JkMount /tomcat-docs/* worker1
Note : Change the paths according to your setup

Hack : Even in Windoze machines, we need to provide '/' for path separators
Never give patch like 'D:\Apache' it will never work. Always give path
as 'D:/Apache' in ALL the config files.

4 : Open files from your /conf folder
and add the following lines :
# Define 1 real worker using ajp13
# Set properties for worker1 (ajp13)
5 : Save all the files.
6 : Restart Apache and Tomcat.
7 : Go to Firefox and give the following URL : http://localhost/tomcat-docs/
8 : You should be able to see the correct page from this apache URL
--Some great information is found here, here, and here.

No comments: