apache虛擬目錄設置方法分享,供大家參考,具體內容如下
1.開啟“虛擬目錄配置文件”httpd-vhosts.conf
文件路徑:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
將以下配置:
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
改為:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
2.設置虛擬目錄可訪問
文件路徑:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
將以下配置:
<Directory /> AllowOverride none Require all denied </Directory>
改為:
<Directory /> AllowOverride none </Directory>
3.添加虛擬目錄
文件路徑:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
添加虛擬目錄
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "D:/_HelloWorld/01_MyProjects/06_PHP/01_Web/Product/Source/Shop" ServerName web.shop.com ErrorLog "logs/web.shop.com-error.log" CustomLog "logs/web.shop.com-access.log" common </VirtualHost>
4.重啟apache
5.在浏覽器中輸入web.shop.com
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持幫客之家。