Home  >  Article  >  Backend Development  >  IIS and Apache share port 80_PHP tutorial

IIS and Apache share port 80_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:36:15978browse

IIS .net program is assumed to be bound to port 81, host name: www.a.com

Apache’s php program is bound to port 80, host name: www.b.com

Then assuming that the apache server has been installed, open the httpd.conf configuration file, find these places and remove #Enable the proxy module:

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

Also make sure to uncomment this:

Include conf/extra/httpd-vhost.conf

Then open the httpd-vhosts.conf file in the apache/conf/extra directory and add the following content at the end:

NameVirtualHost *:80
<VIRTUALHOST *:80>
    ServerName    www.b.com
    DocumentRoot "D:/web/php站点目录"
</VIRTUALHOST >
<VIRTUALHOST *:80>
    ServerName www.a.com
    ProxyPass / http://www.a.com:81/
    ProxyPassReverse / http://www.a.com:81/
</VIRTUALHOST>

Finally, restart both servers, open www.a.com and www.b.com at the same time, and you can access them normally.

---End of recovery content---

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/740285.htmlTechArticleIIS’s .net program is assumed to be bound to port 81, host name: www.a.com apache’s php program is bound Set port 80, host name: www.b.com Then assuming that the apache server has been installed, open httpd.co...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn