This article is grateful to the Chinese to provide, only published, copyright belongs to the original author of all
1, the server IP assumption is 111.111.111.111, the operating system for Windows 2003 server
2, IIS has a asp.net site, domain name is www.a.com, and has been bound, the initial port is 80
3, now need to create a PHP site, you need to use the Web server for Apache. Domain name is www.b.com
Questions raised:
When the client submits HTTP, the default is port 80, and IIS defaults to port 80, and the site is automatically interpreted by IIS when www.a.com is accessed. But when accessing www.b.com, because the server is Apache and the port is 80, it is obvious that IIS and Apache conflict on the server, and of course you can change the IIS and Apache ports. But you do not want users to visit the site is required to add port (http://www.a.com:8080) bar.
Solutions, steps:
Use Apache to proxy IIS to achieve virtual Apache and IIS consolidation. That is, when the user requests a.com and B.Com, the unification is explained by Apache, then Apache will automatically turn virualhost to IIS.
1, set the IIS port to 8080. Here's a little. Visit the http://www.a.com:8080 to see the ASP.net site in IIS.
2, install Apache, download here is apache2.2, note, please download the MSI Win32 program, because the operating system is windows. Please set the Apache port to 80 after installation. The last hint of installation, the details omitted here.
3, start to configure the virtual host. Locate the httpd.conf under Conf under the Apache installation directory and open it with Notepad.
Find these four lines and remove the comments (ie, remove the # before each line)
LoadModule Proxy_module modules/mod_proxy.so
LoadModule Proxy_connect_module modules/mod_proxy_connect.so
LoadModule Proxy_http_module modules/mod_proxy_http.so
LoadModule Proxy_ftp_module modules/mod_proxy_ftp.so
in which you add
Namevirtualhost 111.111.111.111:80
<virtualhost 111.111.111.111:80>
ServerAdmin a@a.com
ServerName www.a.com
DefaultLanguage ZH-CN
Adddefaultcharset GB2312
proxypass/http://www.a.com:8080/
proxypassreverse/http://www.a.com:8080/
</VIRTUALHOST>
The above code is to turn Apache's request to IIS, save the file, restart Apache.
Please visit www.a.com at this time, is it the same as www.a.com:8080?
Ok. A site virtual success. As for the B site can have detailed configuration, such as the default document, etc., omitted here.
The PHP site configuration will be configured at a later time.