SoFunction
Updated on 2025-04-09

IIS6+TOMCAT integration, practical examples!

The integration of IIS6 and Tomcat was done. 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 of all, I will explain my system. Windows 2003 Server Chinese version + IIS6 + Tomcat5.5.17, JDK 1.5 installation directory is D:\JDK1.5, Tomcat installation directory is D:\Tomcat5.5,
The environment variables JAVA_HOME and TOMCAT_HOME are both set and point 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 online. Assume that we have installed Tomcat5 and IIS6 and can both run independently.
Both default websites point to the C:\web directory.
 
Now what we have to do is download isapi_redirector2.dll, JK2 is responsible for the communication between IIS and Tomcat. I put it under D:\tomcat5.5\iis (the directory is casual).
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 "/"!

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

# When using it, replace all localhost and 8009 with your own IP and port.
[: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 

#
=false 
#---------END------------------------------------------------


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

=false 

Next, start editing the registry, create a file directly, copy and save the following horizontal lines 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"="D:\\Tomcat5.5" 
"extensionUri"="/jakarta/isapi_redirector2.dll" 
"workersFile"="D:\\Tomcat5.5\\conf\\" 
"logLevel"="INFO" 
--------------------------------------------------------------

Then open "My Computer -> Control Panel -> Administrative Tools -> Internet Information Service Manager", select the default website in "Website" (I assume that the default website is pointing to e:\), 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 the "Default Website", select "New" -> "Virtual Directory", fill in jakarta, next step, select the directory stored in your isapi_redirector2.dll, mine is d:\tomcat5.5\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 Tomcat 5.5 and then IIS6. Typehttp://localhost:8080/(I put this file under e:\) Check it out! Then take a lookhttp://localhost/, If the execution results of both are the same, congratulations, the integration has been successful!
#########################Notice#########################################################
Q: TOMCAT is installed on disk D. I want to run the JSP file in disk E. How to set it up?
answer:
Example: My Tomcat is installed on D drive
    d:\tomcat-5.5\conf\Catalina\localhost\ 
ROOT is the project name (the default directory can be changed).
The ROOT content is:
        <Context path="/ROOT" docBase="E:\" reloadable="true"/>
docBase is the target address of your project. If you place it in E:\, you can change it directly. .
Example:
The content is:
        <Context path="/ROOT" docBase="E:\" reloadable="true"/>
#####################################################################################

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 is missing or something wrong, and then reconfigure it again.
2. Confirm whether there are files in the common\lib directory under your Tomcat installation directory (Tomcat5.5 seems to be available, but not in Tomcat4. The online documentation rarely mentions this, which caused me to fail many configurations). 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 Services in IIS5.0 isolation mode" should be checked. 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 configurations before)
This article is actually equivalent to reprinting. I just did it. If there is any error, please point it out! Welcome to communicate with me, cnyesoft@, JSP programmer, EJB learning...
Click to download the TXT file
 Click to download isapi_redirector2.dll and files