首页 > 代码库 > wamp 虚拟目录的实现

wamp 虚拟目录的实现

1、修改http.conf文件(D:\wamp\bin\apache\apache2.4.9\conf):

将 Include conf/extra/httpd-vhosts.conf 前面的#去掉;

2、修改httpd-vhosts.conf文件(D:\wamp\bin\apache\apache2.4.9\conf\extra):

将原有的 <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:\Windows\System32\drivers\etc):

加入语句 127.0.0.1 www.ubeacon.com

4、重启wamp所有服务;

以上所做配置为本机设置成了两个虚拟主机 localhost 和 www.ubeacon.com。

wamp 虚拟目录的实现