Home > php教程 > php手册 > IIS与Apache共用80端口

IIS与Apache共用80端口

WBOY
Release: 2016-06-13 09:41:06
Original
903 people have browsed it

  IIS的.net程序假设绑定81端口,主机名:www.a.com

  apache的php程序绑定80端口,主机名:www.b.com

  然后假设apache服务器已经安装完成,打开httpd.conf配置文件,找到这些地方去掉#开启代理模块:

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
Copy after login

  还有确保这里也取消了注释:

Include conf/extra/httpd-vhost.conf
Copy after login

  然后打开apache/conf/extra目录里面的httpd-vhosts.conf文件,在最后添加如下内容:

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>
Copy after login

  最后把两个服务器都重启一下,同时打开www.a.com和www.b.com都能正常访问了。

---恢复内容结束---

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template