win7 php 配置多个网站

1、在C:WINDOWSsystem32driversetc目录下,打开Hosts

添加A站和B站的DNS映射,如
127.0.0.1 local.zhengxin.com
127.0.0.1 local.zhengxinnew.com

2、httpd.conf文件

<VirtualHost *:80>
<Directory "D:/Apache+PHP/Apache24/htdocs/zhengxin">
Options -Indexes +includes
Allow from all
AllowOverride All
</Directory>
ServerAdmin admin@localphp.com
DocumentRoot "D:/Apache+PHP/Apache24/htdocs/zhengxin"
ServerName local.zhengxin.com
#ServerAlias *.localphp.com
ErrorLog logs/zhengxin.com-error_log
</VirtualHost>

<VirtualHost *:80>
<Directory "D:/Apache+PHP/Apache24/htdocs/zhengxinnew">
Options -Indexes +includes
Allow from all
AllowOverride All
</Directory>
ServerAdmin admin@localphp.com
DocumentRoot "D:/Apache+PHP/Apache24/htdocs/zhengxinnew"
ServerName local.zhengxinnew.com
#ServerAlias *.localphp.com
ErrorLog logs/zhengxinnew.com-error_log
</VirtualHost>
原文地址:https://www.cnblogs.com/wuling129/p/4911535.html