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
- C: \ Java \ jdk1.6
Do not forget to configure Environment Variables
3. install Tomcat
My installation directory is Java code
- 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.
- 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
- # Uriworkermap. properties-IIS
- #
- # This file provides sample mappings for example WLB
- # Worker defined in workermap. properties. Minimal
- # The general syntax for 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 will need
- # Secure the access to the/jkmanager URL
- #
- /Jkmanager = jkstatus
- /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.
- <Host name = "www.0431.la" DEBUG = "0" appbase = "C: \ 0431la" unpackwars = "true" autodeploy = "true">
- <Context Path = "" docbase = "C: \ 0431la" DEBUG = "0" reloadable = "true"/>
- </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
- # Uriworkermap. properties-IIS
- #
- # This file provides sample mappings for example WLB
- # Worker defined in workermap. properties. Minimal
- # The general syntax for 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 will need
- # Secure the access to the/jkmanager URL
- #
- /Jkmanager = jkstatus
- /0431la/* = WLB
- /*. 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
- <% @ 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">
- <HTML>
- <Head>
- <Base href = "<% = basepath %>">
- <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 is my page">
- <! --
- <LINK rel = "stylesheet" type = "text/CSS" href = "styles.css">
- -->
- </Head>
- <Body>
- This is my JSP page. <br>
- </Body>
- </Html>
This JSP is automatically generated by the myeclipse project.
- Isapi_redirect-1.2.14.rar (3.9 MB)
- Downloads: 955