Tomcat 4.1.x and IIS 5 on Windows/2000 with mod_jk.dll
IIS 5 comes with Windows/2000 Professional Edition. Since it is "free" and a part of Microsoft, many organizations simply select that as the web server of choice. I will not get into political discussions in this document, other than to note that the Apache httpd server runs on the majority of servers present on the Internet.
That being said, sometimes it is necessary to support configurations for political, cultural, or legacy reasons. This portion of the document shows how to connect a stock IIS 5 to Tomcat 4.1.x using isapi_redirector.dll.
The isapi_redirector.dll referenced in this discussion was downloaded from:
http://apache.mirrors.pair.com/jakarta/tomcat-connectors/jk2/binaries/win32/
%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. Even Windows/2000 doesn't handle this issue in a consistent manner. In short, I recommend to NOT place the Tomcat 4.1.x server in Program Files.
1. Copy isapi_redirector.dll to a reasonable location. While my
{{{ configuration uses %CATALINA_HOME%\bin\win32, this may not be
optimum since the bin directory gets overwritten during a Tomcat
upgrade. 2. Make sure isapi_redirector.dll can be read by System 3. Create a workers.properties file with the following information
{{{ #
- # Where some things are located # workers.tomcat_home=C:\Tomcat workers.java_home=C:\j2sdk1.4.2 workers.apache_log=C:\Apache2\logs # # directory separator # ps= # # create a single worker # worker.list=worker1 # # set this worker as a local ajp13 worker # worker.worker1.type=ajp13 worker.worker1.host=127.0.0.1 worker.worker1.port=8009 worker.worker1.lbfactor=50 worker.worker1.cachesize=10 worker.worker1.cache_timeout=600 worker.worker1.socket_keepalive=1 worker.worker1.socket_timeout=300 }}}
4. Place this file in %CATALINA_HOME%\conf 5. Make sure this file is readable by System 6. Create a uriworkermap.properties file with the following {{{ information.
- # # mapping dynamic content only # /examples/*.jsp=worker1 /examples/servlet/*=worker1
- }}}
NOTE: I keep configuration files in APACHE_HOME%\conf, since I normally run Apache 2.0.x. Keeping them in another (safe) location is certainly an option.
7. Edit the registry and create the following entry in
{{{ HKEY_LOCAL_MACHINE
SOFTWARE
Apache Software Foundation - Jakarta Isapi Redirector
1.0
- extension_uri /jakarta/isapi_redirect.dll log_file C:\Tomcat\logs\jk.log log_level INFO worker_file C:\Apache2\conf\workers.properties worker_mount_file C:\Tomcat\conf\uriworkermap.properties
- }}}
NOTE: Change the locations of the worker_file, worker_mount_file, and log_file to fit your installation. The resulting entry should look like the png (to be provided later).
IMPORTANT: You CANNOT have mod_jk2 and mod_jk entries both active in your registry.
8. Use the IIS management console to add a new virtual directory wit
{{{ the name of jakarta. 9. The physical path must be the directory where you copied isapi_redirector.dll. My location is C:\Tomcat\bin\win32 10. Mark the directory with execute access. The end result is shown in the png (to be provided later). 11. Right mouse button on the web site, and select properties from the drop-down menu. 12. Select the ISAPI Filters tab and add isapi_redirector.dll as a filter. Call it jakarta. See the two images (to be provided later). 13. In the Documents tab, add index.html and index.jsp as default files to serve when entering a directory. See the image (to be provided later). 14. Add a virtual directory for /examples and point it to {{{ %CATALINA_HOME%\webapps\examples. This will enable IIS to serve
- static information in those directories. See the image (to be provided later). }}}
15. Shut down the IIS 5 web server using Services, NOT the management console. 16. Shut down the Tomcat 4.1.x server 17. Start the Tomcat 4.1.x server 18. Verify that it is running by browsing http://localhost:8080 19. Start the IIS 5 web server 20. Open the IIS management console, right mouse click on the entire web site and select Properties from the drop down menu. 21. Verify that a green up arrow appears next to the jakarta ISAPI filter. See the image (to be provided later). 22. 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 }}}
23. 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 }}}
24. If they are the same, you have Tomcat 4.1.x talking to IIS {{{ 5.
- }}}