wamp多站点配置,wamp站点配置网上方法五花白门,特意记录一下,需要的朋友自行拿去就好。
需要修改的文件:httpd.conf / httpd-vhosts.conf / hosts
对应路径:
httpd.conf:wamp\bin\apache\apache2.2.21\conf
httpd-vhosts.conf:wamp\bin\apache\apache2.2.21\conf\extra
hosts:c\windows\system32\drivers\etc
修改流程:
1,打开httpd.conf,约466行:#include conf/extra/httpd-info.conf,删除#;
2,还是httpd.conf,约188行:
options followsymlinks
allowoverride none
order deny,allow
deny from all
改为:
options followsymlinks
allowoverride none
order deny,allow
#deny from all
allow from all
#允许所有访问
satisfy all
3,打开httpd-vhosts.conf,在最下方空白处添加以下代码(自行修改wamp安装路径):
serveradmin webmaster@dummy-host.example.com
documentroot f:/wamp/www
servername localhost
serveralias www.dummy-host.example.com
errorlog logs/dummy-host.example.com-error.log
customlog logs/dummy-host.example.com-access.log common
serveradmin webmaster@dummy-host.example.com
documentroot f:/wamp/www2
servername www2.com
serveralias www.dummy-host.example.com
errorlog logs/dummy-host.example.com-error.log
customlog logs/dummy-host.example.com-access.log common
4,最后一步:打开hosts文件,在最后一行下面添加以下代码:
127.0.0.1 localhost
127.0.0.1 www2.com
重启wamp之后,localhost与www2.com即可区分开发,多站点配置成功。
http://www.bkjia.com/phpjc/1051882.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/1051882.htmltecharticlewamp多站点配置,wamp站点配置 网上方法五花白门,特意记录一下,需要的朋友自行拿去就好。 需要修改的文件:httpd.conf / httpd-vhosts.conf /...