SoFunction
Updated on 2025-03-10

Integration of IIS6 and Tomcat5

It took a long time to finally get the integration of IIS6 and Tomcat. Now post the steps for you to refer to, which also eliminates the novice's rush and debugging on Google again and again. Let's get started!
First, let me explain my system. Windows 2003 Server Chinese version + IIS6 + Tomcat 5.0.14, JDK 1.4.2 installation directory is C:\JDK, Tomcat installation directory is C:\Tomcat, and the environment variables JAVA_HOME and TOMCAT_HOME have been set and pointed to their respective installation directories. (Note that if the tomcat path is involved in all files in the next file, please modify it to your own Tomcat path)
I won’t talk about the installation of Tomcat5 and IIS6. There are a lot of documents on the Internet. Assume that we have installed Tomcat5 and IIS6 and can run independently. The default websites of both point to the C:\web directory.

What we have to do now is to /dist/jakarta/tomcat-connectors/jk2/binaries/win32/jakarta-tomcat-connectors-jk2.0. Go to download JK2, and JK2 is responsible for the communication between IIS and Tomcat. After unzipping, I get isapi_redirector2.dll, I put it in C:\tomcat\iis (the directory is random).
Next, create a file in the conf directory under the Tomcat installation directory, copy the following section and save it. Note that the path in file=".." should be used with "/"!


[shm]
file=c:/Tomcat/logs/
size=1048576

# When using it, replace all localhost and 8009 with your own IP and ports
[:localhost:8009]
port=8009
host=localhost

# define the worker
[ajp13:localhost:8009]
channel=:localhost:8009

# Uri mapping
[uri:/*.jsp]
[uri:/web/*]
worker=ajp13:localhost:8009

# define the worker
[status:status]

# Uri mapping
[uri:/jkstatus/*]
worker=status:status

 

Then edit the file and confirm whether there is this sentence:

=false

Next, start editing the registry, create a file directly, copy the following paragraph and save it, and double-click to import the information into the registry. (Note that change the Tomcat path involved to your Tomcat path)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\2.0]
"serverRoot"="c:\\Tomcat"
"extensionUri"="/jakarta/isapi_redirector2.dll"
"workersFile"="c:\\Tomcat\\conf\\"
"logLevel"="INFO"


Then open "My Computer -> Control Panel -> Administrative Tools -> Internet Information Service Manager", select the default website in "Web" (I assume that the default website is pointing to C:\web), right-click on it and select "Properties", select "ISAPI Filter" in the pop-up page box, click "Add", fill in jakarta, and fill in the absolute path of your isapi_redirector2.dll in the executable file. Click OK to close the property page after OK. Right-click on "Default Website", select "New" -> "Virtual Directory", fill in jakarta, next step, select the directory stored in your isapi_redirector2.dll, mine is C:\tomcat\iis. Next step, remember to check the "Execute" item in permissions, OK, it's done.
If you are using IIS5, you can end it here, but IIS6 is not finished yet, continue.
Right-click on "Web Service Extensions" in "Web Services Manager" in "Web Services Extensions" and select "Add a new Web Services Extensions". Fill in the extension in the pop-up box (it doesn't matter). Select "Add" for "requested files" and then find your isapi_redirector2.dll and "OK". "Set the extension status to allow" also check it to confirm.
OK, the configuration is finished. Now we start Tomcat5 and then net start w3svc start IIS6. Type http://localhost:8080/ (This file I placed under c:\web) and take a look! Then look at http://localhost/. If the execution results of both are the same, congratulations, the integration has been successful!

But maybe it's not possible at this time, you should confirm the following points:
1. Is jakarta in your "Internet Information Service Manager" -> "Website" -> "Default Website" -> "Properties" -> "ISAPI Filter" a green arrow upward? If it is red, check if the configuration you made before or something is written wrong, and then reconfigure it again
2. Confirm whether there are files in the common\lib directory under your Tomcat installation directory (it seems to be there in Tomcat5, but not in Tomcat4. The online documentation rarely mentions this, which caused me to fail many times of configuration). If not, copy one from the JDK lib.
It is best to point to the directory that Tomcat points to, otherwise the problem of not finding images and other resource files. (This does not affect execution, haha!)
4. The English document also mentioned that IIS6 should be set to IIS5 isolation mode, "Internet Information Service Manager" -> "Website" -> "Properties" -> "Services", and "Run WWW Service in IIS5.0 isolation mode" is marked. But I can use it normally without ticking it. If you don't configure it successfully, you can try this.

Not OK yet? OK, let’s do it. Open the chassis, take out the hard drive, throw it on the ground and step on me, step on me, step on me! You still dare to fight me ^_^ (Just kidding, but I was really helpless and upset after failing many times before)
This article is actually equivalent to reprinting. I am only responsible for inputting it. If there are any errors, please point it out! Welcome to communicate with me, ymer@, JSP programmer, EJB learning...

Reference URL:/~ack5504/tomcat-iis6-howto/
 /