It took a long time to finally complete the integration of IIS6 and Tomcat. Now I post the steps to give you some reference, and also save novices from running around on Google and debugging again and again. Let’s get started!
First, let me explain my system, Windows 2003 Server Chinese version + IIS6 + Tomcat5.0.14, JDK 1.4.2 installation directory is C:JDK, Tomcat installation directory is C:Tomcat, environment variables JAVA_HOME and TOMCAT_HOME have been set and Point to their respective installation directories. (Note that if the tomcat path is involved in all subsequent files, please modify it to your own Tomcat path)
I won’t go into the installation of Tomcat5 and IIS6. There are many documents on the Internet. It is assumed that we have installed Tomcat5 and IIS6 at this time and can run independently. The default websites of both point to the C:web directory.
Now what we have to do is go to
[shm]
file=c:/Tomcat/logs/jk2.log
size=1048576
# In actual use, replace all localhost and 8009 with your own IP 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
Then edit the jk2.properties file and confirm whether there is this sentence in it:
request.tomcatAuthentication=false
Next, start editing the registry, directly create an iis.reg file, copy the following paragraph into it and save it, then double-click iis.reg to import the information into the registry. . (Note, change the involved Tomcat path to your Tomcat path)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESOFTWAREApache Software FoundationJakarta Isapi Redirector2.0]
"serverRoot"="c:\Tomcat"
"extensionUri"="/jakarta/isapi_redirector2.dll"
"workersFile"="c:\Tomcat\conf\workers2.properties"
"logLevel"="INFO"
Then open "My Computer->Control Panel->Administrative Tools->Internet Information Services Manager", select the default website in "Website" (I assume the default website points to C:web), and right-click on it Select "Properties", select "ISAPI Filter" in the pop-up page box, click "Add", fill in jakarta as the filter name, and fill in the absolute path of your isapi_redirector2.dll in the executable file. Click "OK" after "OK" to close the property page. Then right-click on the "Default Website", select "New" -> "Virtual Directory", fill in jakarta as the alias, next step, select the path to the directory where your isapi_redirector2.dll is stored, mine is C:tomcatiis, next In the first step, remember to check the "Execute" item in the permissions. Okay, done.
If you are using IIS5, you can end it here, but IIS6 is not finished yet, continue.
Right-click on "Web Service Extension" in "Website" of "Internet Information Services Manager" and select "Add a new Web Service Extension". In the pop-up box, fill in the extension name Tomcat (actually it doesn't matter), "Required File" select "Add" and then find your isapi_redirector2.dll and "OK". Also check "Set extension status to allowed" and confirm.
Okay, the configuration is complete. Now we start Tomcat5, and then net start w3svc starts IIS6. Type http://localhost:8080/hello.jsp (I placed this file under c:web) and take a look! Then take a look at http://localhost/hello.jsp . If the execution results of the two are the same, congratulations, the integration is successful!
But maybe it’s not possible at this time. At this time, you should confirm the following points:
1. Is the jakarta in your "Internet Information Services Manager"->"Website"->"Default Website"->"Properties"->"ISAPI Filter" an upward green arrow? If it is red, check whether the configuration you made before is missing or written incorrectly, and reconfigure it again. 2. Confirm whether there is a tools.jar file in the commonlib directory under your Tomcat installation directory ( It seems to be available in Tomcat5, but not in Tomcat4. Online documents rarely mention this, which caused me to fail to configure it many times). If not, copy it from the JDK lib.
3. The directory pointed by IIS should be consistent with the directory pointed by Tomcat, otherwise the problem of not being able to find images and other resource files will occur. (This does not affect execution, haha!)
4. The English document also mentions that IIS6 should be set to IIS5 isolation mode, "Internet Information Services Manager" -> "Website" -> "Properties" -> "Service", and change "Run WWW in IIS5.0 isolation mode" Service" tick. However, I can use it normally without ticking it. If you fail to configure it, you can also try this.
Not yet? Okay, let's get serious, open the case, take out the hard drive, throw it to the ground and let me step on it, step on it, step on it! See if you dare to contradict me ^_^ (Just kidding, but I was really helpless and annoyed after many failed configurations before)
This article is actually a reprint. I am only responsible for typing it. If there are any errors, please point them out! Welcome everyone to communicate with me, [email protected] , JSP programmer, learning EJB...
Reference website: https://www.rit.edu/~ack5504/tomcat-iis6-howto/tomcat-iis6 -howto.html
http://www.downcodes.com/3181.html