1. 找到hosts文件
C:\Windows\System32\drivers\etc
最后加入,你想要访问的网址,如:
127.0.0.1 localhost
127.0.0.1 wechatqy.com
127.0.0.1 js
2.找到Apache下httpd.conf文件,我的目录是E:\AppServ\Apache2.2\conf
去掉#
#Include conf/extra/httpd-vhosts.conf
去掉#
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
端口Listen 80后面加上,如:
Listen 80
Listen 81
Listen 82
3.找到Apache下httpd-vhosts.conf文件,我的目录是E:\AppServ\Apache2.2\conf\extra
最后面加入
<VirtualHost *:80>
DocumentRoot "E:/AppServ/www"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "E:/AppServ/www/weixinqy"
ServerName wechatqy
</VirtualHost>
<VirtualHost *:80>
DocumentRoot
"E:/AppServ/www/JavaScript"
ServerName js
</VirtualHost>
4.重启apache,大功告成.
原文:http://www.cnblogs.com/1haojia/p/3737124.html