Make IIS 6 support JSP (IIS integrates Tomcat)

Source: Internet
Author: User
Reprinted token.
And Related web programs (Asp, Asp.net) are also everywhere.
We hope that the web programs developed by Java can coexist with IIS (published using port 80 together ).
There are a lot of tutorials on the Internet, most of which are copied after the copy, so that some details have been vague, and I have taken many detours. Leave a footprint here to prevent future errors.
Software and Environment
Windows Server 2003
In IIS 6.0
Tomcat 6.0.20
JDK 6.0
JK isapi_redirect-1.2.14 (in many cases it is because the isapi_redirect version does not match, I have used the latest 1.2.28 but not integrated successfully you can try, this software seems not very easy to find, I will give it in the attachment)
1. Install IIS
Control Panel --> add and delete programs --> add and delete Windows Components

Test

2. Install the Java environment. JDK instead of JRE is used here.
Install Java code 

  1. C: \ Java \ jdk1.6

Do not forget to configure Environment Variables
3. install Tomcat
My installation directory is Java code 

  1. C: \ tomcat6

Start Tomcat
Test port 8080

4. The basic work is completed. We will integrate it below.
Install isapi_redirect-1.2.14 of course can also be directly written manually using the isapi_redirect-1.2.14.dll + configuration file, but for the first installation is recommended to use the installation file, to prevent the configuration file writing errors caused by integration fails.

 

All the way to next
The installation directory is Java code. 

  1. C: \ Program Files \ Apache Software Foundation \ Jakarta ISAPI Redirector

5. Open the IIS Management Interface
Check whether the default site exists

 

The virtual directory of Jakarta in
And viewing the attribute

 

Whether the Jakarta filter exists. As for the up-Green Arrow, there may not be (many on the Internet have pointed out that this is required, in fact, only the first access after configuration, loading) as long as it is not red.
If not, create,
Add the Filter Name Jakarta file address c: \ Program Files \ Apache Software Foundation \ Jakarta ISAPI redirector \ bin \ isapi_redirect.dll
Create virtual directory

 

Alias Jakarta (required) path c: \ Program Files \ Apache Software Foundation \ Jakarta ISAPI redirector \ bin \
Access permission

 
Do not forget to check the script execution check box
OK
8. Create a project under the Tomcat app. Here is the directory name 0431la.
Modify configuration file
C: \ Program Files \ Apache Software Foundation \ Jakarta ISAPI redirector \ conf \ uriworkermap. properties Java code 

  1. # Uriworkermap. properties-IIS
  2. #
  3. # This file provides sample mappings for example WLB
  4. # Worker defined in workermap. properties. Minimal
  5. # The general syntax for this file is:
  6. # [Url] = [worker name]
  7. /Admin/* = WLB
  8. /Manager/* = WLB
  9. /JSP-examples/* = WLB
  10. /Servlets-examples/* = WLB
  11. # Optionally filter out all. JPEG files inside that context
  12. # For no mapping the URL has to start with exclamation (!)
  13. ! /Servlets-examples/*. JPEG = WLB
  14. #
  15. # Mount jkstatus to/jkmanager
  16. # For production servers you will need
  17. # Secure the access to the/jkmanager URL
  18. #
  19. /Jkmanager = jkstatus
  20. /0431la/* = WLB

Restart Tomcat and IIS and access the test.
To restart IIS, right-click my computer and choose manage to restart it.

 

Next we can test

Okay, although this is not our final result, at least we have configured it.

Next we will configure the virtual host
9. Place the 0431la directory to the C root directory and configure Tomcat's virtual host Java code. 

  1. <Host name = "www.0431.la" DEBUG = "0" appbase = "C: \ 0431la" unpackwars = "true" autodeploy = "true">
  2. <Context Path = "" docbase = "C: \ 0431la" DEBUG = "0" reloadable = "true"/>
  3. </Host>

10. Configure the ing directory of the virtual host under IIS
Add the Jakarta virtual directory and ISAPI filter configuration. For more information, see Step 5.

11. modify the configuration file
C: \ Program Files \ Apache Software Foundation \ Jakarta ISAPI redirector \ conf \ uriworkermap. properties Java code 

  1. # Uriworkermap. properties-IIS
  2. #
  3. # This file provides sample mappings for example WLB
  4. # Worker defined in workermap. properties. Minimal
  5. # The general syntax for this file is:
  6. # [Url] = [worker name]
  7. /Admin/* = WLB
  8. /Manager/* = WLB
  9. /JSP-examples/* = WLB
  10. /Servlets-examples/* = WLB
  11. # Optionally filter out all. JPEG files inside that context
  12. # For no mapping the URL has to start with exclamation (!)
  13. ! /Servlets-examples/*. JPEG = WLB
  14. #
  15. # Mount jkstatus to/jkmanager
  16. # For production servers you will need
  17. # Secure the access to the/jkmanager URL
  18. #
  19. /Jkmanager = jkstatus
  20. /0431la/* = WLB
  21. /*. Jsp = WLB

Submit JSP requests to Tomcat for processing
Haha
Restart IIS and tomcat to see our results

We can take the test, but the jsp request is completely parsed. Java code 

  1. <% @ Page Language = "Java" Import = "Java. util. *" pageencoding = "ISO-8859-1" %>
  2. <%
  3. String Path = request. getcontextpath ();
  4. String basepath = request. getscheme () + ": //" + request. getservername () + ":" + request. getserverport () + path + "/";
  5. %>
  6. <! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en">
  7. <HTML>
  8. <Head>
  9. <Base href = "<% = basepath %>">
  10. <Title> my JSP 'index. jsp 'starting page </title>
  11. <Meta http-equiv = "Pragma" content = "no-Cache">
  12. <Meta http-equiv = "cache-control" content = "no-Cache">
  13. <Meta http-equiv = "expires" content = "0">
  14. <Meta http-equiv = "keywords" content = "keyword1, keyword2, keyword3">
  15. <Meta http-equiv = "Description" content = "this is my page">
  16. <! --
  17. <LINK rel = "stylesheet" type = "text/CSS" href = "styles.css">
  18. -->
  19. </Head>
  20. <Body>
  21. This is my JSP page. <br>
  22. </Body>
  23. </Html>

This JSP is automatically generated by the myeclipse project.

  • Isapi_redirect-1.2.14.rar (3.9 MB)
  • Downloads: 955
  • View image attachments
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.