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---