1、C:\Windows\System32\drivers\etc\hosts——>下方填写域名;
127.0.0.1 www.xxxx.com
2、apache\conf\extra\httpd-vhosts.conf——>
<VirtualHost *:80>
ServerAdmin www.xxxx.com
DocumentRoot "项目的目录"
ServerName www.xxxx.com
<Directory "项目的目录">
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
3、apache\conf\httpd.conf文件,在文件底部加入以下代码
打开配置文件httpd.conf,并去掉#Include conf/extra/httpd-vhosts.conf前面的#号!!