我经历了很多帖子阅读并2点在同一个IP地址配置WAMP如下(httpd.conf中摘录):本地主机
#Tell Apache to identify which site by name
NameVirtualHost *:80
#Tell Apache to serve the default WAMP server page to "localhost"
<VirtualHost 127.0.0.1>
ServerName localhost
DocumentRoot "C:/wamp/www"
</VirtualHost>
#Tell Apache configuration for 1 site
<VirtualHost 127.0.0.1>
ServerName client1.localhost
DocumentRoot "C:/wamp/www_client1"
<Directory "C:/wamp/www_client1">
allow from all
order allow,deny
AllowOverride all
</Directory>
DirectoryIndex index.html index.php
</VirtualHost>
#Tell Apache configuration for 2 site
<VirtualHost 127.0.0.1>
ServerName client2.localhost
DocumentRoot "C:/wamp/www_client2"
<Directory "C:/wamp/www_client2">
allow from all
order allow,deny
AllowOverride all
</Directory>
我也改变了Windows主机文件添加127.0.0.1 client1.localhost等。但是,当我重新启动WAMP服务时,//client1.localhost和//client2.localhost将转到c:\ wamp \ www文件夹中的默认站点。
任何帮助真的很感激。
所以,你得到一个警告......你看过吗?它说什么? –
警告消息是标准的“虚拟主机127.0.0.1:80与虚拟主机127.0.0.1:80重叠,第一个优先。也许你需要虚拟主机指令” – user2236230