It took a long time to complete IIS6 and Tomcat integration. Now, I will post the steps for your reference, which frees you from getting involved on Google and debugging again and again. Start!
First, describe my system. For Windows 2003 Server, the Chinese version + IIS6 + Tomcat5.0.14, JDK 1.4.2 installation directory is C: \ JDK, and Tomcat installation directory is C: \ Tomcat, the environment variables JAVA_HOME and TOMCAT_HOME have been set and point to their respective installation directories. (Note: If tomcat paths are involved in all files, change them to your own Tomcat path)
I will not talk about the installation of Tomcat 5 and IIS6. There are many documents on the Internet. Assuming that Tomcat 5 and IIS6 have been installed and can run independently, the default websites of the Two refer to C: \ web directory.
Now what we have to do is go to the http://apache.linuxforum.net/dist/jakarta/tomcat-connectors/jk2/binaries/win32/jakarta-tomcat-connectors-jk2.0.2-win32-IIS.zip to download JK2, The JK2 is responsible for the communication between IIS and Tomcat, after unlocking get isapi_redirector2.dll, I put it in C: \ tomcat \ iis (directory casually ).
Next, create a workers2.properties file under the conf directory under the Tomcat installation directory, and copy the following section to save it. Note that the path in file = "..." must be!
[Shm]
File = c:/Tomcat/logs/jk2.log
Size = 1048576
# Replace all localhost and 8009 with your own IP address and port.
[Channel. socket: localhost: 8009]
Port = 8009
Host = localhost
# Define the worker
[Ajp13: localhost: 8009]
Channel = channel. socket: localhost: 8009
# Uri mapping
[Uri:/*. jsp]
[Uri:/web/*]
Worker = ajp13: localhost: 8009
# Define the worker
[Status: status]
# Uri mapping
[Uri:/jkstatus/*]
Worker = status: status
Edit the jk2.properties file and check whether the following sentence exists:
Request. tomcatAuthentication = false
Next, edit the registry, directly create an iis. reg file, copy the following section, save it, and double-click iis. reg to import the information to the Registry. (Note: Change the involved Tomcat path 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 \ workers2.properties"
"LogLevel" = "INFO"
Choose "my computer"> "Control Panel"> "Administrative Tools"> "Internet Information Service Manager", and select the default website in "website: \ web), right click on it, select "attribute", select "ISAPI filter" in the pop-up window, click "add", and enter "jakarta" as the Filter Name, enter the absolute path of your isapi_redirector2.dll In the executable file. Click "OK" to close the property page. Right-click "default website" and choose "New"> "virtual directory". Enter jakarta as the alias. Next, select "path" as the directory where your isapi_redirector2.dll is stored. My directory is C: \ tomcat \ iis, next step. Remember to tick the "execute" item in the permission.
If you are using IIS5, you can end it here, but IIS6 is not complete yet. Continue.
Right-click "Web Service extension" in "website" of "Internet Information Service Manager" and choose "Add a new Web Service extension ", in the pop-up box, set the extension to Tomcat (which doesn't matter), select "add" for "requested files", find your isapi_redirector2.dll, and click "OK ". "Set the extension status to allow" is also checked, OK.
Now, the configuration is complete. Now we start Tomcat 5, and then net start w3svc starts IIS6. Type http: // localhost: 8080/hello. jsp (this file is stored in c: \ web! Then let's take a look at http: // localhost/hello. jsp. If the execution results are the same, congratulations, integration is successful!
However, it may not work at this time. You should confirm the following points:
1. Your "Internet Information Service Manager"-> "website"-> "default website"-> "properties"-> "ISAPI filter" is the upward Green Arrow of jakarta? If it is red, check whether your previous configuration is missing or if something is wrong, and reconfigure it again.
2. check whether the common \ lib directory in your Tomcat installation directory contains tools. jar file (Tomcat5 seems to exist, but it does not exist in Tomcat4. This is rarely mentioned in online documents, which causes my configuration to fail multiple times ), if no, copy one from JDK lib.
3. The directory to which IIS points should be the same as the directory to which Tomcat points. Otherwise, the image and other resource files cannot be found. (This does not affect execution !)
4. IIS6 should also be set to IIS5 Isolation Mode, "Internet Information Service Manager"-> "website"-> "attribute"-> "service ", check "Run WWW Service in IIS5.0 Isolation Mode. However, it can be used normally without being checked. If the configuration is not successful, you can try this.
Not yet? Okay, let's hit it. Open the chassis, take out the hard disk, and throw it to the ground to step on, step on, and step on! It seems that you dare to stick with me ^_^ (joke, but I have been helpless and annoyed after many failed configurations)
This article is actually reprinted. I am only responsible for the input. If there is an error, please point it out! Welcome to communicate with me, ymer@21cn.com, JSP programmer, EJB learning ......
Https://www.rit.edu /~ Ack5504/tomcat-iis6-howto/tomcat-iis6-howto.html
Http://www.knowsky.com/3181.html