网站目录:D:\development\phpenvironment\phpsite
访问域名:xx
1、修改hosts,增加:
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 xx
2、修改Apache的httpd.conf (在Apache安装目录下的conf目录下面)
在文件的最后增加:
<VirtualHost *:80>
ServerName xx
DocumentRoot "D:/development/phpenvironment/phpsite"
<Directory />
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
重启动Apache,OK
注意:如果VirtualHost配置里面少了
<Directory />
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
会提示:HTTP 错误 403
Forbidden You don't have permission to access \ on this server.