使用下面的东西虚拟主机工作 Apache;
D:\wamp\bin\apache\apache2.2.8\conf\extra
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.localhost
#DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.localhost"
DocumentRoot "D:/wamp/www/"
ServerName localhost
#ServerAlias www.dummy-host.localhost
ErrorLog "logs/dummy-host.localhost-error.log"
CustomLog "logs/dummy-host.localhost-access.log" common
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.localhost
# DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost"
DocumentRoot "D:/wamp/www/facebook_post_style"
ServerName localhost1
ErrorLog "logs/dummy-host2.localhost-error.log"
CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.localhost
# DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost"
DocumentRoot "D:/wamp/www/crop"
ServerName www.example.net
ErrorLog "logs/dummy-host2.localhost-error.log"
CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>
在主机:
C:\Windows\System32\drivers\etc\hosts
127.0.0.1 localhost
127.0.0.1 localhost1
127.0.0.1 www.example.net
单击任务栏中的 wamp 图标 > Apache > httpd.conf
启用下面的行
虚拟主机
包括 conf/extra/httpd-vhosts.conf