iis6.0+tomcat7.0 Integration Summary (recommended) _tomcat

Source: Internet
Author: User
Tags tomcat tomcat server

(a) Why should IIS and Tomcat be integrated together?
If you encounter this situation, you have developed a Javaweb project to deploy to the server, but the server has already deployed ASP, asp.net or PHP projects are running in the IIS environment, your tomcat can no longer use the port 80, then you must consider the integration of IIS and Tomcat work together. Online collection of a lot about the integration of Tomcat and IIS articles, most of the ambiguous writing, negligence every detail is difficult to integrate successfully, after analysis of practice, I decided to spend a little time to share this summary, I hope the use of friends can help.

(ii) The following is an introduction to my successful Software environment:

• Service Platform Window Server 2003
üiis6.0 (most servers are already installed by default)
Üapache-tomcat-7.0.29.exe (recommended to the official website to download, I am here is the installation version)
Üjdk-7u1-windows-7.0.exe (recommended to the official website to download)
Üisapi_redirect-1.2.14.exe (I used here is the installation version of, not install version of the need to write configuration files and manual configuration of the registry, the principle is the same, in order to avoid errors, easy to recommend the installation version)
Download Address: http://www.jb51.net/softs/186731.html

(c) Software installation is the installation sequence is very necessary, the following is the sequence of software installation:

IIS6.0 => JDK => Tomcat => isapi_redirect, you can either do this in this order or not, but the order is based on the premise that IIS must take precedence over isapi_redirect otherwise isapi_redirect Ann The install will not find IIS causing the configuration to be incorrect and the JDK must take precedence over Tomcat otherwise setup Tomcat will not be able to install the JRE. In addition, the JDK is preferable to isapi_redirect.

Settings for JDK environment variables:

Use the mouse to right-click My Computer-> Properties-> Advanced-> Environment variables
System variable-> new-> variable name: Java_home variable value: C:\Program files\java\jdk1.7.0_01
System variable-> new-> variable name: CLASSPATH variable value:.; %java_home%\lib
System variable-> edit-> variable name: Path at the front of the variable value plus:%java_home%\bin;
There is an English period in the Classpath "." followed by a semicolon indicating the meaning of the current path
settings for Tomcat environment variables:
use the mouse to right-click My Computer-> Properties-> Advanced-> Environment variables
System variable-> new-> variable name: Tomcat_home variable Value: D:\Program files\apache Software Foundation\tomcat 7.0

(iv) Verify that the software is installed correctly:

• Verify that the isapi_redirect is installed correctly: Isapi_redirect's installation directory can be defined by itself, and it is not necessary to install it on the web, which says it must be installed in Tomcat and directory.
After installing Isapi_redirect you will notice that a virtual directory appears under the IIS Default Web site Jakarta

Right-click Virtual directory Jakarta View Properties

Whether there is a Jakarta filter. As for the green arrows up there may not be (many on the web have pointed out that the requirements thus, in fact only after the first visit after configuration, only to load) as long as it is not red. For that, your isapi_redirect is installed correctly.

• Verify that the JDK environment variable is configured correctly, start = "Run =" Enter cmd = "Enter the result of the command in the Java command or Javac or java–version, if there is a correct JDK configuration
• Verify that Tomcat is installed correctly: whether the input http://localhost:8080 in the browser appears


If this page appears, Tomcat is installed correctly;

Note: Check to see if the Lib directory under the Tomcat installation directory contains tools.jar files, and if it is not possible to copy a Tools.jar to Tomcat's Lib directory in the JDK, the file is critical, otherwise isapi_redirect will not work properly.

• Verify that IIS is working in a normal browser and that the input http://localhost appears

If it appears, IIS is working properly
None of the above verification problems, then our preparation work is completed. Below we will do the corresponding configuration work.

(v) Tomcat configuration:

In Tomcat configuration is mainly configured virtual directory, open Tomcat Server.xml file, join

Xmlvalidation= "false" Xmlnamespaceaware= "false" >
<context path= "" "Docbase=" D:\webroot "debug=" 0 "reloadable=" true "/>
</Host>

Name: It corresponds to the domain name of your project;
AppBase: The path of the virtual directory;
Dobase: The top-level directory of the project is equivalent to the directory name in WebApps;
When the configuration is complete, remember to copy your items to the D:\webroot directory, and my project is ecshoping
Note: Tomcat's port is the default port 8080 do not modify
To verify that your virtual directory is configured correctly, open the browser input: test.jb51.net:8080 to see if you can access your project, and if so, how your project is deployed in Tomcat is correct.
Note: If the firewall is on, notice to add the port in the exception of the firewall: 8080 ensure the port is open to the outside. Also make sure your domain name is resolved correctly

(vi) IIS configuration:

• Create a new Web site with a random name

"Site IP Address":(all Unassigned)
"Host header for this site": Domain name (same as the domain name in the ' name ' attribute of the Tomcat\conf\server.xml <Host> label)
Site Home directory path: virtual path + folder name (virtual path in the "AppBase" attribute of the tomcat\conf\server.xml"Allow the following permissions": Read, run script, execute
• Create a virtual directory name under this site: Jakarta (required)
"Path": Isapi_redirect installation directory \ Bin (Isapi_redirect.dll directory)
"Allow the following permissions": Read, run script, execute
U site--> right key--> properties:
1 "ISAPI filter"--> Add--> "Filter Name": Jakarta "Executable": Isapi_redirect installation directory \bin\isapi_redirect.dll (isapi_redirect.dll Thing
2 "Document":--> add--> "Default content page": for example index.jsp (corresponding to the site default home)--> OK--> The rest of the deleted
Üweb Service Extension--> Right---> add a new Web service extension: "extension": Jakarta (required)
"Required files": Isapi_redirect installation directory \bin\isapi_redirect.dll (isapi_redirect.dll file)
Check "set extended state to allow" save

(vii) configuration of Isapi_redirect

Open the Isapi_redirect directory, modify the Uriworkermap.properties file, the contents of the file is as follows:
# Uriworkermap.properties-iis
#
# This file provides sample mappings to example WLB
# worker defined in Workermap.properties.minimal
# the genera L syntax for this file is:
# [url]=[worker name]
 
/admin/*=wlb
/manager/*=wlb
/jsp-examples/ *=WLB
/servlets-examples/*=wlb
/ecshoping/*=wlb
 
# Optionally filter out all. jpeg fi Les inside that context
# for no mapping the URL has to start with exclamation (!)
 
!/servlets-examples/*.jpeg=wlb
 
#
# Mount Jkstatus To/jkmanager
# for production Servers you'll need to
# secure the access to The/jkmanager URL
#
/jkmanager=jkstatus
/*.jsp =WLB
/*.action=wlb
/*.do=wlb
/*=wlb 
 
Explanation: WLB can be understood as filter name

/*.jsp et cetera for the rules that request filtering, Isapi_redirect determines that when IIS receives the request, it is given to Tomcat. /ECSHOPING/*=WLB Specify the items you want to filter
Open the Isapi_redirect directory under the Conf directory, modify the Workers.properties.minimal file, the file's internal entry as follows:
# Workers.properties.minimal-
#
# This file provides minimal JK configuration properties needed to
# Connect to Tomcat.
#
# The workers that JK should create and work with
#

Worker.list=wlb,jkstatus

#
# Defining a worker named ajp13w and of type ajp13
# This is the name and the type do not have to match.
#
Worker.ajp13w.type=ajp13
Worker.ajp13w.host=localhost
worker.ajp13w.port=8009

#
# Defining a Load Balancer
#

Worker.wlb.type=lb
worker.wlb.balance_workers=ajp13w

#
# Define Status Worker
#

Worker.jkstatus.type=status

This file is the default configuration, generally do not need to modify, to ensure that consistent with the above line
So you can just pour a cup of coffee and enjoy the success of the integration. When you enter your domain, you can directly access your Javaweb project without adding 8080 ports. When IIS accepts a JSP Web site Isapi_redirect forwards it to Tomcat and then returns the processing results to the customer.

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.