win7 php 配置多个网站
1、在C:\WINDOWS\system32\drivers\etc目录下,打开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>