wamp 虚拟目录的实现

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

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

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

将原有的 <VirtualHost *:80></VirtualHost> 删除;code

加入如下语句:blog

<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>

三、修改hosts文件(C:\Windows\System32\drivers\etc):io

加入语句 127.0.0.1 www.ubeacon.comclass

四、重启wamp全部服务;配置

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

相关文章
相关标签/搜索