Configuration environment: win2003 + iis6 + apache2 + tomcat6 + mysql5
Configuration Requirements: All web applications can be accessed externally through port 80, that is, port 80 is shared.
Configuration scheme: iis runs asp, aspx, php applications, tomcat runs jsp applications, and apache acts as a proxy.
Configuration steps:
1. Install iis and set the listening port to 8081, apache to 80, tomcat to 8080, and mysql to be installed by default.
2. Configure apache proxy
Modify the conf/httpd. conf file and enable proxy_module and proxy_http_module. The modified content is as follows:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
Add the following lines to the conf/httpd. conf file:
ProxyPass/php! (I use iis to parse php. This line is commented out)
ProxyPass/asp/http: // localhost: 8081/
ProxyPassReverse/asp/http: // localhost: 8081/
ProxyPass/jsp/http: /localhost: 8080/
ProxyPassReverse/jsp/http: // localhost: 8080/
3. apache Virtual Host Configuration
Modify the conf/httpd. conf file. The modified content is:
Include conf/extra/httpd-vhosts.conf
In <Directory>, set the Directory permissions for each Service's website. For example, mine is:
<Directory "D:/Tomcat/webapps">
AllowOverride None
Options None
Order allow, deny
Allow from all
</Directory>
<Directory "E:/htdocs">
AllowOverride None
Options None
Order allow, deny
Allow from all
</Directory>
Modify the VM configuration file, conf/extra/httpd-vhosts.conf, add the following labels:
<VirtualHost *: 80>
ServerAdmin test@test.com.
ProxyPreserveHost On
ProxyPass/http: // 127.0.0.1: 8080/
ProxyPassReverse/http: // 127.0.0.1: 8080/
ServerName jsp.com "> www.jsp.com
</VirtualHost>
<VirtualHost *: 80>
ServerAdmin test@test.com.
ProxyPreserveHost On
ProxyPass/http: // 127.0.0.1: 8081/
ProxyPassReverse/http: // 127.0.0.1: 8081/
ServerName asp.com "> www.asp.com
</VirtualHost>
4. tomcat Virtual Host Configuration
Modify conf/server. xml and add the following labels:
<Host name = "www.jsp.com" debug = "0" appBase = "e: \ htdocsmain" unpackWARs = "true" autoDeploy = "true">
<Context path = "" docBase = "."/>
<Valve className = "org. apache. catalina. valves. AccessLogValve" directory = "logs" prefix = "www_jsp_com_access_log ."
Suffix = ". txt" pattern = "common" resolveHosts = "false"/>
<Logger className = "org. apache. catalina. logger. FileLogger" directory = "logs" prefix = "www_jsp_com_log." suffix = ". txt" timestamp = "true"/>
Configure a virtual host with the domain name www.jsp.com and set its root directory to e: \ htdocsmain.
5. iis virtual host settings
I will not talk about configuring iis to parse php here. The online information is complete.
Create a website and set the Host header to www.asp.com. root directory e: htdocsasp
Start all services
Access:
Http://www.jsp.com
Http://www.jsp.com: 8080
Http://www.asp.com
Http://www.asp.com: 8081
Configuration successful!