Integrate Tomcat and Apache on Windows with mod_jk
This will discuss how to integrate Apache and Tomcat on Windows.
I have already installed WAMP 1.7.3 and Tomcat 5.5.25 on a Windows XP Box.
One of the reasons Im doing this is to remove port 8080 from the tomcat urls.
How you do this is by proxying requests from port 80 in apache to tomcat on port 8080 via the way of the mod_jk connector.
There are directions here on the tomcat site, however hopefully these instructions are simpler and to the point.
http://tomcat.apache.org/connectors-doc/generic_howto/quick.html
Get binarys for mod_jk from apache
http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/
I renamed the .so file to just mod_jk.so (to remove the version)
Assume that $HTTPD_HOME is where Apache is installed. In my case this is the directory Apache2 inside of the directory that I installed WAMP into.
Stop apache and tomcat
1.copy mod_jk.so into $HTTPD_HOME/modules
2. put a file workers.properties to $HTTPD_HOME/conf
# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
3.edit $HTTPD_HOME/conf/httpd.conf and add to the end of the file
Obviously you should substitute whatever the directory is that you have installed apache / $HTTPD_HOME for c:/wamp/apache2/
LoadModule jk_module modules/mod_jk.so
JkWorkersFile "c:/wamp/apache2/conf/workers.properties"
JkShmFile "c:/wamp/apache2/logs/mod_jk.shm"
JkLogFile "c:/wamp/apache2/logs/mod_jk.log"
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# Send everything for context to worker worker1
#must have a mount for each context / webapp
#in my case I have pebble installed which this blog is running on
JkMount /pebble/* worker1
4.make sure you add proxyPort="80" to the ajp connector configuration inside of $CATALINA_HOME/conf/server.xml (this is the one assoicated with port 8009
For some reason this is not mentioned directly in the apache directions
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009"
proxyPort="80"
enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
5. Lastly and I couldn’t get this to work without opening port 8009 in my firewall, that is the port that the tomcat ajp connector above is listening on
Restart apache and tomcat and if your url with tomcat was
http://robsinner.blogsite.org:8080/pebble
now you can also use
