2017-04-24 114 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启动的帐户有权访问该网络共享,并且该共享在引导机器时可用,并且不需要任何人为干预。

相关问题