First of all, using IIS to connect directly to tomcat, searched all the information on the Internet, but the dead or not even, perhaps IIS closed bar, it seems that Tomcat and IIS far from becoming friends.
So had to find a way, with the Apache listening 80来 do request forwarding, request to the site of IIS to go to the corresponding directory, request to Tomcat under the site forward to Tomcat, then began to look for this information, finally after repeated trial, right to overcome the difficulty of requesting servlet error , and now I can finally continue to do my own website.
Reference Documentation:
1.http://weblife.blogbus.com/s1659/index.html
2.http://wiki.osportfolio.org/confluence/display/technical/apache+tomcat+mod_jk+integration
The first document basically solves all the problems, and the second document solves the problem of requesting a servlet to be unable to find the target
The next step is to configure three servers to coordinate their work, starting from scratch.
1. Download and install Apache2
Download apache2.0.55 for Windows
I can't find it on the official website, it's weird. After downloading to the local double-click can be installed, after the installation of the system tray should see a small icon, is a feather and green play arrow icon, which means the correct installation, if not properly installed, please confirm that 80 ports are not owned by another server.
2. Download and install TOMCAT5
Tomcat or to the official website to download, choose 5.5.17 Core:zip, I am more accustomed to using this compression package, after decompression set environment variable can be used. You can start Tomcat by running Startup.bat in the bin of the installation path.
3. Install IIS6.0
Insert the Win2003 installation disk into the CD drive, select Add/Remove Windows components in the Add or Remove Programs, select Application Server in the Windows Components Wizard, and then click on the check box to follow the wizard prompts for the next step. IIS6.0 does not start properly after installation because the default port 80 is already occupied by Apache. Double-click to open the Administrative Tools/internet Information Services (IIS) Manager, and on the default Web site (stop), right-click Select Properties and modify TCP port 80 to 88 or another port on the Web Site tab to determine. If you select the Default Web site (stop) and then click the Play icon in the toolbar, you can start IIS, and the word "stop" after normal startup disappears.
4. Test 3 Servers
Modify Apache installation directory/htdocs index.html.en renamed to Index.html, in the browser input http://localhost return if you see the Apache welcome interface, the Apache is running. Enter http://localhost:8080 carriage return in the browser if you see the Tomcat welcome interface, this means that Tomcat is working properly. Enter http://localhost:88 carriage return in the browser if you see a prompt in build, this means that IIS is running.
5. Configure Apache and Tomcat connections
The first step: in http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.6
Download the Mod_jk_1.2.6_2.0.50.dll file, rename it to mod_jk.so and place it in the Apache2/modules directory.
Step two: Open Notepad, enter the following statements, and save the file name in the Workers.properties directory under the Tomcat installation directory/conf:
Copy Code code as follows:
Workers.tomcat_home=c:\program files\jakarta-tomcat-5.0.28
Workers.java_home=c:\program files\java\jdk1.5.0_06
Ps=\
Worker.list=ajp13
worker.ajp13.port=8009
Worker.ajp13.host=localhost
Worker.ajp13.type=ajp13
Worker.ajp13.lbfactor=1
Step three: Open the end of the apache/conf/httpd.conf file with Notepad and add the following paragraph:
Copy Code code as follows:
LoadModule Jk_module modules/mod_jk.so
Jkworkersfile "D:\Program files\jakarta-tomcat-5.0.28\conf\workers.properties"
<virtualhost *:80>
ServerAdmin rabbit69@openria.com
ServerName localhost
DirectoryIndex index.html index.htm index.jsp
Jkmount/* AJP13
Jkautoalias "C:\Program Files\jakarta-tomcat-5.0.28\webapps"
<directory "C:\Program Files\jakarta-tomcat-5.0.28\webapps" >
Options Indexes FollowSymLinks
Allow from all
</Directory>
</VirtualHost>
Save, stop the Apache service, and when you start, you can apply the new configuration.
6. Test Apache connection to Tomcat
Enter http://localhost carriage return in the server if you see the Tomcat welcome interface, it means Apache and Tomcat are integrated successfully, LocalHost followed by the Jsp-examples directory or the Servlet-examples directory to see the following example, in order to allow the servlet to run, I have a long time to modify the httpd.conf file.
7. Configure Apache and IIS6 connections
Step One: Modify the httpd.conf file to enable the proxy module
LoadModule proxy_module modules/mod_proxy.so and LoadModule proxy_http_module the "#" of the two sentences in the file get rid of it.
Step two: Increase the virtual host of IIS
Add the following code at the end of the httpd.conf file:
Copy Code code as follows:
<virtualhost *:80>
ServerAdmin rabbit69@openria.cn
ServerName localhost
DocumentRoot "C:/inetpub/wwwroot"
DirectoryIndex index.html index.htm index.asp
Alias/test "C:/inetpub/wwwroot"
<directory "C:/inetpub/wwwroot" >
Options MultiViews
AllowOverride None
Order Allow,deny
Allow from all
</Directory>
proxypass/http://127.0.0.1:88/
proxypassreverse/http://127.0.0.1:88
</VirtualHost>
Save and restart Apache to do the testing.
8. Test APACEH connection to IIS
Write an ASP page, Hello.asp:
Copy Code code as follows:
<HTML>
<HEAD>
<title>hello World sample</title>
</HEAD>
<BODY>
<% Response.Write "Hello World"%>
</BODY>
</HTML>
Under C:/inetpub/wwwroot, access to http://localhost/test/hello.asp carriage return in the browser if the word "Hello World" appears, the configuration is successful. If the page appears blank, the Active Server page is allowed in the Web service extensions in Internet Information Services (IIS) Manager, and then the cache is flushed, and the page should be refreshed to see Hello World.
The meaning of the specific parameters is not much said, the above reference documents are described.
Postscript:
Always thought that the integration problem can not be solved, but I still do not reconciled, why other people can adjust, I will not pass, bitter brain ah, today finally solved, last night also got 1 more, all the hard work did not baixia, write this, do a souvenir, also hope to encounter this problem netizens have help, Without the internet there will be no growth for everyone.