IIS6 + Tomcat integration, practical examples!

Time:2021-10-20

Completed the integration of IIS6 and Tomcat. Now post the steps for your reference, and it will save novices from running wild on Google and debugging again and again. Let’s go!  
First, explain my system, windows   two thousand and three   Server Chinese version + IIS6 + Tomcat 5.5.17, JDK   1.5 the installation directory is D: \ JDK1.5, and the Tomcat installation directory is D: \ tomcat5.5,
     Environment variable Java_ Home and Tomcat_ Home is set up and points to their respective installation directory. (note that if the Tomcat path is involved in all files, please modify it to your own Tomcat path)  
        I won’t talk about the installation of tomcat5 and IIS6. There are many documents on the Internet. Suppose we have installed tomcat5 and IIS6 and can run independently,
     The default web sites for both point to the C: \ web directory.  
   
Now all 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 (directory).  
Next, create a worker 2.properties file in the conf directory under the Tomcat installation directory, and copy the following paragraph to save. Note that the path in file = “..” should use “/”!  

#———-START——————————————–
[shm] 
file=c:/Tomcat/logs/jk2.log 
size=1048576 

#   In practice, 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 

#
request.tomcatAuthentication=false 
#———END————————————————

Then edit the jk2.properties file to confirm whether there is this sentence:  

  request.tomcatAuthentication=false 

Next, start editing the registry, directly create an iis.reg file, copy the section between the horizontal lines below and save it, and then double-click iis.reg to import the information into the registry. (note that 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”=”D:\\Tomcat5.5″ 
  ”extensionUri”=”/jakarta/isapi_redirector2.dll” 
  ”workersFile”=”D:\\Tomcat5.5\\conf\\workers2.properties” 
  ”logLevel”=”INFO” 
————————————————————–

Then open “my computer – > control panel – > Administrative Tools – > Internet Information Service Manager”, select the default website in “website” (I assume the default website points to e: \ cnyesoft. Com), right-click it and select “properties”, select “ISAPI filter” in the pop-up page box, click “add”, and fill in Jakarta for the filter name, Fill your ISAPI in the executable_ Absolute path to redirector2.dll. Click OK after OK to close the property page. Right click the “default website”, select “new” – > “virtual directory”, and fill in Jakarta as the alias. Next, select your ISAPI as the path_ The directory where redirector2.dll is stored is D: \ tomcat5.5 \ IIS. Next, remember to tick the “execute” item in the permission. OK, finish.  
If you use iis5, you can end here, but IIS6 is not finished yet. Continue.  
Right click “web service extension” in “website” of “Internet Information Service Manager” and select “add a new web service extension”. In the pop-up box, fill the extension name with Tomcat (it doesn’t matter), select “add” for “required files”, and then find your ISAPI_ “OK” after redirector2.dll. Check “set extension status as allowed” and confirm.  
All right, configuration is finished. Now let’s start Tomcat 5.5 and then IIS6. typinghttp://localhost:8080/hello.jsp(I put this file under E: \ cnyesoft. Com) have a look! Then look at ithttp://localhost/hello.jsp, if the results are the same, Congratulations! The integration is successful!  
#########################Attention#########################################################
Q: Tomcat is installed on disk D. I want to run the JSP file in disk E. how can I set it?
Answer:
     Example: my Tomcat is installed on disk D
    d:\tomcat-5.5\conf\Catalina\localhost\ROOT.xml 
     Root is the project name (the default directory, which can be changed).  
     The root content is:
        <Context path=”/ROOT” docBase=”E:\cnyesoft.com” reloadable=”true”/>
         Docbase is the target address of your project. If you put it in E: \ cnyesoft.com, you can change it directly..  
     Example:
         The content of root.xml is:
        <Context path=”/ROOT” docBase=”E:\cnyesoft.com” reloadable=”true”/>
#####################################################################################

But maybe not at this time. At this time, you should confirm the following points:  
1. Is Jakarta an upward green arrow in your Internet Information Service Manager – > Website – > default website – > properties – > ISAPI filter? If it is red, check whether the configuration you made before is missing or wrong, and reconfigure it again  
2. Confirm whether there are tools.jar files in the common \ lib directory under your Tomcat installation directory (tomcat5.5 seems to be available, but not in tomcat4. This is rarely mentioned in online documents, resulting in my repeated configuration failures). If not, copy them from the Lib of JDK.  
3. The directory pointed to by IIS should be consistent with the directory pointed to by tomcat, otherwise the image and other resource files will not be found. (this does not affect execution, hehe!)  
4. The English document also mentioned that IIS6 should be set to iis5 isolation mode, “Internet Information Service Manager” – > “website” – > “properties” – > “service”, and tick “running WWW service in IIS5.0 isolation mode”. However, I can use it normally without checking. If your configuration is unsuccessful, you can also try this.  

Not yet? OK, let’s be cruel. Open the chassis, take out the hard disk, throw it on the ground and step on it! Look how dare you fight me^_^ (I’m kidding, but I’m really helpless and annoyed after many failed configurations)  
This article is actually a reprint. I just operated it once. If there are any errors, please point out! Welcome to communicate with me, [email protected] , JSP programmer, EJB learning  
Click to download txt file
 Click to download ISAPI_ Redirector2.dll and its files

Recommended Today

[webpack series] advanced level

This article will continue to introduce morewebpackConfiguration, it is recommended to read it first[webpack series] BasicsContent of the. If you find any errors in the text, please correct them in the comments area. All the code in this article can be found ingithubFound. Packaging multi page applications Previously, we configured a single page application, but […]