Let IIS6 support JSP Setup methods (IIS perfectly consolidates Tomcat) _tomcat

Source: Internet
Author: User
Tags tomcat

We all know that in the MS family IIS as an Internet server is famous, simple and convenient.
and the relevant web programs (asp,asp.net) are everywhere.
We want Java-developed web programs to coexist with IIS (use 80-port publishing together).
This aspect of the tutorial online a lot, mostly copy after copy, so that some details have been vague, but also led me to go a lot of detours. Leave a footprint here to prevent future mistakes.
Software and Environment
Windows Server 2003
IIS 6.0
Tomcat 6.0.20
JDK 6.0
JK isapi_redirect-1.2.14 (in many cases due to the Isapi_redirect version does not match, I used the latest 1.2.28 but not the integration of success you can try, the software seems to be not very easy to find, cloud-Habitat community for everyone to provide a local download, Faster)

1. Install IIS

Control Panel--> Add Remove program--> Add Remove Windows Component



Test


2. Install Java environment, use JDK instead of JRE
I install to

Copy Code code as follows:

c:\java\jdk1.6

Don't forget to configure environment variables

3. Install Tomcat

My installation directory is

Copy Code code as follows:

C:\tomcat6

Start Tomcat
Test port 8080



4. The basic work complete below we carry on the conformity
The installation isapi_redirect-1.2.14 of course can also be written directly using the Isapi_redirect-1.2.14.dll + profile, but for the first installation it is recommended that you use the installation files to prevent errors in the configuration file writing resulting in unsuccessful consolidation.


All the way Next
The installation directory is

C:\Program Files\apache Software Foundation\jakarta Isapi Redirector

5. Open the Admin interface for IIS

to see if the default site exists

The Jakarta virtual directory in




and see if there is a Jakarta filter in the property



. 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.
If not created,
Add filter name Jakarta file address C:\Program files\apache Software foundation\jakarta Isapi redirector\bin\isapi_ Redirect.dll
Create virtual directory



alias Jakarta (must) path C:\Program files\apache Software Isapi Re director\bin\
Access Permissions


Do not forget to run the script check
OK
8. We're building a random project under the Tomcat app. 0431la
Modify Profile
C:\p Rogram files\apache Software foundation\jakarta Isapi redirector\conf\uriworkermap.properties

# uriworkermap.properties-iis # This
file provides the sample mappings for example WLB
# worker defined in WOR Kermap.properties.minimal # The general syntax to this
file is:
# [url]=[worker name]

/admin/*=wlb
/ MANAGER/*=WLB
/jsp-examples/*=wlb
/servlets-examples/*=wlb

# Optionally filter out all. jpeg files 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
/0431la/*=wlb

We reboot tomcat and IIS and access the tests
IIS reboot can be restarted with the right mouse button on my Computer--> management




Then we can test it out.





OK, it's not our final result, but at least we've got no problem with the configuration.

Here we do the configuration of the virtual host
9. We put the 0431la directory into the C-packing directory and configure Tomcat's virtual host

Copy Code code as follows:

<context path= "" "Docbase=" C:\0431la "debug=" 0 "reloadable=" true "/>
</Host>

10. Configure the virtual host's mapping directory under IIS
and add the Jakarta virtual directory and ISAPI filtering configuration process to the fifth step

11. Modify the configuration file
C:\Program files\apache Software Foundation\jakarta Isapi redirector\conf\uriworkermap.properties

Copy Code code as follows:

# Uriworkermap.properties-iis
#
# This file provides sample mappings for example WLB
# Worker defined in Workermap.properties.minimal
# The general syntax to this file is:
# [Url]=[worker name]

/admin/*=wlb
/manager/*=wlb
/jsp-examples/*=wlb
/servlets-examples/*=wlb

# Optionally filter out all. jpeg files inside the context
# for no mapping the URL has to start with exclamation (!)

!/servlets-examples/*.jpeg=wlb

#
# Mount Jkstatus To/jkmanager
# for production servers your'll need to
# Secure the access to The/jkmanager URL
#
/jkmanager=jkstatus
/0431la/*=wlb
/*.jsp=wlb

Allow JSP requests to be handled by Tomcat
Oh
Restart IIS and Tomcat look at our results.


We can test, but the JSP request is completely parsed.

Copy Code code as follows:

<%@ page language= "java" import= "java.util.*" pageencoding= "Iso-8859-1"%>
<%
String path = Request.getcontextpath ();
String basepath = request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/";
%>

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
<base href= "<%=basePath%>" rel= "External nofollow" >

<title>my JSP ' index.jsp ' starting page</title>
<meta http-equiv= "Pragma" content= "No-cache" >
<meta http-equiv= "Cache-control" content= "No-cache" >
<meta http-equiv= "Expires" content= "0" >
<meta http-equiv= "keywords" content= "keyword1,keyword2,keyword3" >
<meta http-equiv= "description" content= "This are my page" >
<!--
<link rel= "stylesheet" type= "Text/css" href= "Styles.css" rel= "External nofollow" >
-->

<body>
This is the My JSP page. <br>
</body>

The JSP is automatically generated by the MyEclipse project.

Related Article

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.