1.修改httpd.conf文件
启用httpd-vhosts.conf配置文件
找到这句话"#Include conf/extra/httpd-vhosts.conf"
修改为Include conf/extra/httpd-vhosts.conf,去掉#。
2、找到如下目录D\wamp\bin\apache\apache2.4.9\conf\extra下的httpd-vhosts.conf文件,修改httpd-vhosts.conf,加入类似下面内容:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
<VirtualHost *:80>
ServerAdmin admin@localhost.com
DocumentRoot "D:/path/foldername"
ServerName www.sitename.com
ServerAlias www.sitename.com
ErrorLog "logs/ sitename.log"
CustomLog "logs/ sitename.log" common
<Directory " D:/path/foldername ">
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all(ap2.4以前的加这个)
Require all granted(ap2.4以后的加这个)
</Directory>
</VirtualHost>
|
3.修改hosts(C:\Windows\System32\drivers\etc)文件,在最后加下面一句话
1
|
127.0.0.1 www.sitename.com
|