2017-04-24 170 views
0

因此,我在Windows上安裝了WAMP以運行Apache和PHP,並且我需要創建轉到網絡共享\\ 10.0.0.177 \ FMS Studios \ Websites的虛擬主機。當我去到域時,我得到了一個403錯誤。這是我在我的httpd-vhosts.conf文件:如何使用網絡共享創建虛擬主機?

<VirtualHost *:80> 
    ServerName tree.fmsds.xyz 
    DocumentRoot "\\10.0.0.177\FMS Studios\Websites" 
    <Directory "\\10.0.0.177\FMS Studios\Websites"> 
     AllowOverride All 
     Require all granted 
     Order deny,allow 
    </Directory> 
</VirtualHost> 

,它甚至沒有登記在WAMP的服務器管理器中的虛擬主機..

WAMP does not see my virtualhost.

403 Error

+0

刪除'訂單否認,允許'多數民衆贊成在Apache 2.2語法,並不能與'需要所有授予'這是Apache 2.4語法 – RiggsFolly

+0

仍然403錯誤。 – Flyingmcsquid

回答

0

第一的所有更容易使用正斜槓或者如果您使用反斜槓您必須逃脫所有斜槓

第二你shoul □不混合的Apache 2.2和2.4語法,因此,如果您正在使用Apache 2.4.x中刪除舊的語法

<VirtualHost *:80> 
    ServerName tree.fmsds.xyz 
    DocumentRoot "//10.0.0.177/FMS Studios/Websites" 
    <Directory "//10.0.0.177/FMS Studios/Websites"> 
     AllowOverride All 
     Require all granted 
     # remove this as its Apache 2.2 syntax 
     #Order deny,allow 
    </Directory> 
</VirtualHost> 

或者使用反斜槓看起來像這樣

<VirtualHost *:80> 
    ServerName tree.fmsds.xyz 
    DocumentRoot "\\\\10.0.0.177\\FMS Studios\\Websites" 
    <Directory "\\\\10.0.0.177\\FMS Studios\\Websites"> 
     AllowOverride All 
     Require all granted 
     # remove this as its Apache 2.2 syntax 
     #Order deny,allow 
    </Directory> 
</VirtualHost> 

現在,作爲其阿帕奇將需要訪問網絡共享時,需要確保Apache啓動的帳戶有權訪問該網絡共享,並且該共享在引導機器時可用,並且不需要任何人爲干預。

相關問題