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

相關文章
相關標籤/搜索