Tomcat 4.1.x and Apache 2.0.x on Windows/2000 with mod_jk2.dll
One of the nice benefits of using the same servers on both platforms is that the configuration (except for directory delimiters) is the same. This eases the system administration burden.
%APACHE_HOME% refers to the root directory of the Apache 2.0.xx installation (which is C:\Apache2 for this machine). %CATALINA_HOME% refers to the root directory of the Tomcat 4.1.xx installation (which is C:\Tomcat for this machine).
I realize that the Windows default is to place all programs in { { { %SystemDrive%\Program Files } } }. Personally, I think putting a command delimiter (space) in the name of a directory or file is not very useful. Windows/2000 doesn't even handle this issue in a consistent manner. In short, I recommend to NOT place the Apache and Tomcat servers in Program Files.
1. Copy mod_jk2.dll to %APACHE_HOME%\modules
2. Make sure mod_jk2.dll can be read by System
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 System 6. Create a workers2.properties file with the following information
{{{ #
- # basic workers2.properties file # # # shared memory #
- ["shm"]
- file=C:/Apache2/logs/shm.file size=1048576 [workerEnv:] info=Global server options timing=1 debug=0 # # IP socket channel # [channel.socket:localhost:8009] port=8009 host=127.0.0.1 # # define the ajp13 worker # [ajp13:localhost:8009] channel=channel.socket:localhost:8009 # # Uri mapping examples - jsp files only # [uri:/examples/*.jsp] worker=ajp13:localhost:8009 # # Uri mapping examples - all servlets # [uri:/examples/servlet/*] worker=ajp13:localhost:8009 }}}
7. Place this file in %APACHE_HOME%\conf. 8. Make sure this file is readable by System. 9. Create the shm.file file. One way to do this is by opening up a {{{ DOS window and doing the following:
COPY CON: > shm.file (a few blank lines) ^Z }}}
10. Make sure that the shm.file file is rw for System. 11. Add the following in %APACHE_HOME%\conf\httpd.conf to load {{{ mod_jk2.dll
- # # Adding mod_jk2 #
LoadModule jk2_module modules/mod_jk2.dll }}}
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
- information. Alias /examples/ "C:/Tomcat/webapps/examples/"
- }}}
NOTE: Replace { { { C:/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
http://localhost:8080/examples/jsp/dates/date.jsp http://localhost:8080/examples/servlets/ http://localhost:8080/examples/servlet/HelloWorldExample }}}
20. If they are the same, you have Tomcat 4.1.x talking to Apache {{{ 2.0.x.
- }}}