Tomcat 4.1.x and IIS 5 on Windows/2000 with mod_jk2.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_redirector2.dll.

The isapi_redirector2.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_redirector2.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_redirector2.dll can be read by System 3. Create a jk2.properties file with the following information

{{{ #

4. Place this file in %CATALINA_HOME%\conf 5. Make sure this file is readable by System 6. Create a jk2.workers file with the following information.

{{{ #

NOTE:I keep configuration files and shared memory files in %APACHE_HOME%, 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 

NOTE: Change the serverRoot value to reflect your installation. It should be the same as %CATALINA_HOME%. Change the workersFile location to reflect your installation. The completed entry will look like the png image (to be provided).

8.   Use the IIS management console to add a new virtual directory with
{{{     the name of jakarta. 

9. The physical path must be the directory where you copied      isapi_redirector2.dll.  My location is C:\Tomcat\bin\win32  10. Mark the directory with execute access. The end result is shown      in the png image (to be provided).  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_redirector2.dll as a      filter.  Call it jakarta.  See the two images (to be provided).  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).  14. Add a virtual directory for /examples and point it to {{{ %CATALINA_HOME%\webapps\examples. This will enable IIS to serve

15. Create the shm.file file. One way to do this is by opening up a {{{ DOS window and doing the following:

16. Make sure that the shm.file file is rw for System. 17. Shut down the IIS 5 web server using Services, NOT the management      console.  18. Shut down the Tomcat 4.1.x server 19. Start the Tomcat 4.1.x server 20. Verify that it is running by browsing http://localhost:8080 21. Start the IIS 5 web server 22. Open the IIS management console, right mouse click on the entire      web site and select Properties from the drop down menu.  23. Verify that a green up arrow appears next to the jakarta ISAPI      filter.  See the image (to be provided).  24. Verify the connection by browsing the following:

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

25. Compare the results to the following:

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

26. If they are the same, you have Tomcat 4.1.x talking to IIS {{{ 5.

Alternative method

There is a setup http://www.shiftomat.com/opensource/ that does all that for you.

WinJK2IIs (last edited 2009-09-20 23:31:58 by localhost)