apache虛擬目錄和虛擬主機的設置

配置虛擬目錄


修改httpd.conf

1.增加模塊

<IfModule dir_module>
    DirectoryIndex index.php index.html index.htm
    Alias /www  "D:/www"
    <Directory D:/www>
    Order allow,deny
    Allow from all
    </Directory>
</IfModule>


2.註釋DocumentRoot "C:/AppServ/www"

3.重啓apache


配置虛擬主機

修改httpd.conf

1.啓用  虛擬主機 Include conf/extra/httpd-vhosts.conf

2.打開  extra/httpd-vhosts.conf 增加虛擬模塊

  <VirtualHost 127.0.0.1:80>
    DocumentRoot "D:/www"
    DirectoryIndex index.php index.html index.htm
    <Directory />
    options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
</VirtualHost>

3.修改hosts

127.0.0.1  www.xxx.com

4.重啓apache




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章