1、修改http.conf文件(D:wampinapacheapache2.4.9conf):
将 Include conf/extra/httpd-vhosts.conf 前面的#去掉;
2、修改httpd-vhosts.conf文件(D:wampinapacheapache2.4.9confextra):
将原有的 <VirtualHost *:80></VirtualHost> 删除;
加入以下语句:
<VirtualHost *:80> DocumentRoot D:/wamp/www ServerName localhost <Directory "D:/wamp/www"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot D:/wamp/www/ubeacon ServerName www.ubeacon.com <Directory "D:/wamp/www/ubeacon"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost>
3、修改hosts文件(C:WindowsSystem32driversetc):
加入语句 127.0.0.1 www.ubeacon.com
4、重启wamp所有服务;
以上所做配置为本机设置成了两个虚拟主机 localhost 和 www.ubeacon.com。