Tomcat 4.1.x and Apache 2.0.x on Linux with mod_jk2.so

$APACHE_HOME refers to the root directory of the Apache 2.0.xx installation (which is /home/apache for this machine). $CATALINA_HOME refers to the root directory of the Tomcat 4.1.xx installation (which is /home/tomcat for this machine). Make the appropriate changes for your installation.

1.   Copy mod_jk2.so to $APACHE_HOME/modules
2.   Make sure mod_jk2.so is rwx for the owner of the httpd process
3.   Create a jk2.properties file with the following information

{{{     # 
     # Socket configuration 
     # 
     handler.list=request,container,channelSocket 

     # 
     # socket configuration 
     # 
     channelSocket.port=8009 
     channelSocket.address=127.0.0.1 
     channelSocket.maxPort=port+10 

4. Place this file in $CATALINA_HOME/conf 5. Make sure this file is readable by owner of the tomcat process 6. Create a workers2.properties file with the following information

{{{ #

7. Place this file in $APACHE_HOME/conf. 8. Make sure this file is readable by the owner of the httpd process 9. Create the shm.file file using touch 10. Make sure that the shm.file file is rw for both the owner of the httpd process and the owner of the tomcat process 11. Add the following in $APACHE_HOME/conf/httpd.conf to load mod_jk2.so

{{{ #

12. Add the following in $APACHE_HOME/conf/httpd.conf to map the {{{ Tomcat information. This will allow Apache 2.0.x to serve static

NOTE: Replace /home/tomcat with your location of Tomcat.

13.  Shut down the Apache 2.0.x server
14.  Shut down the Tomcat 4.1.x server
15.  Start the Tomcat 4.1.x server
16.  Verify that it is running by browsing http://localhost:8080
17.  Start the Apache 2.0.x server
18.  Verify the connection by browsing the following:

{{{     http://localhost/examples/jsp 
     http://localhost/examples/jsp/dates/date.jsp 
     http://localhost/examples/servlets/ 
     http://localhost/examples/servlet/HelloWorldExample 

19. Compare the results to the following:

{{{ http://localhost:8080/examples/jsp

20. If they are the same, you have Tomcat 4.1.x talking to Apache {{{ 2.0.x.

LinuxJK2 (last edited 2009-09-20 23:31:59 by localhost)