IIS6 + TOMCAT integration, practical instances!

Source: Internet
Author: User

Completed 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.5.17, the JDK 1.5 installation directory is D: \ JDK1.5, And the Tomcat installation directory is D: \ Tomcat5.5,
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 a lot of documents on the Internet. Suppose we have installed Tomcat 5 and IIS6 and can run them independently,
By default, both websites point to the C: \ web directory.
  
Now we need to download isapi_redirector2.dll, and JK2 is responsible for communication between IIS and Tomcat. I put it under D: \ tomcat5.5 \ 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!

# ---------- START --------------------------------------------
[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

#
Request. tomcatAuthentication = false
# --------- END ------------------------------------------------

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 from the crossline to 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" = "D: \ Tomcat5.5"
"ExtensionUri" = "/jakarta/isapi_redirector2.dll"
"WorkersFile" = "D: \ Tomcat5.5 \ conf \ workers2.properties"
"LogLevel" = "INFO"
--------------------------------------------------------------

Choose "my computer"> "Control Panel"> "Administrative Tools"> "Internet Information Service Manager", and select the default website in "website: \ cnyesoft.com), right-click on it and select "properties". In the displayed dialog box, select "ISAPI filter" and click "add". Set the Filter Name to jakarta, 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 path is d: \ tomcat5.5 \ iis. Next, 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 Tomcat5.5 and then start IIS6. Type http: // localhost: 8080/hello. jsp (this file is stored in e: \ cnyesoft.com! Then let's take a look at http: // localhost/hello. jsp. If the execution results are the same, congratulations, integration is successful!
############## ######################################## ###
Q: How do I set TOMCAT to run JSP files in drive E when it is mounted to drive D?
A:
For example, I installed Tomcat on disk D.
D: \ tomcat-5.5 \ conf \ Catalina \ localhost \ ROOT. xml
ROOT is the project name (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 place it on E: \ cnyesoft.com, you can directly change it ..
Example:
The content of Root. XML is:
<Context path = "/ROOT" docBase = "E: \ cnyesoft.com" reloadable = "true"/>
######################################## ######################################## #####

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.5 seems to exist, but Tomcat4 does not exist. This is rarely mentioned in the documentation on the internet, causing many configuration failures ), 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 just did it again. If there is an error, please point it out! Welcome to communicate with me, cnyesoft@126.com, JSP programmer, EJB learning ......
Click to download the TXT file
Click to download isapi_redirector2.dll and the file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.