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 /...