为什么这个VirtualDocumentRoot安装程序返回403 Access Forbidden?

我有安装我的httpd-vhosts.conf与以下的derectives:

 UseCanonicalName Off LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon CustomLog logs/access_log vcommon <VirtualHost 192.168.1.100:80> VirtualDocumentRoot "E:/Web Development Projects/%3/%2.1/%2+" DirectoryIndex index.php index.html index.htm default.html default.htm home.html default.php home.php </VirtualHost> <VirtualHost 192.168.1.100:443> SSLEngine On SSLCertificateFile "E:/Web Development Projects/SSL/apache.crt" SSLCertificateKeyFile "E:/Web Development Projects/SSL/apache.key" VirtualDocumentRoot "E:/Web Development Projects/%3/%2.1/%2+" DirectoryIndex index.php index.html index.htm default.html default.htm home.html default.php home.php </VirtualHost> 

但不幸的是,我的networking本地服务器返回一个“403访问被禁止”的消息。

请注意,这个相同的configuration安装在另一台机器上,工作正常。

这个设置有什么问题吗?

有人可以帮我吗?

注意:我的文件结构是E:/Web Development Projects/tld/i/domain.tld/ where

  1. tld是我的本地顶级域名(dch)
  2. i是域名初始
  3. domain.tld是项目的域名

这使我有以下文件系统结构

 E:\ Web Development Projects\ dch\ a\ a-project.dch\ Files another-project.dch\ Files \z z-project.dch\ Files 

更新#1

我只是应用了下面的说明,但是Apache仍然没有启动。

这里是我的httpd-vhosts.conf的修改:

 UseCanonicalName Off LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon CustomLog logs/access_log vcommon <VirtualHost 192.168.1.100:80> VirtualDocumentRoot "E:/Web Development Projects/%3/%2.1/%2+" DirectoryIndex index.php index.html index.htm default.html default.htm home.html default.php home.php <Directory "E:/Web Development Projects/"> Order deny, allow Require all granted </Directory> </VirtualHost> <VirtualHost 192.168.1.100:443> SSLEngine On SSLCertificateFile "E:/Web Development Projects/SSL/apache.crt" SSLCertificateKeyFile "E:/Web Development Projects/SSL/apache.key" VirtualDocumentRoot "E:/Web Development Projects/%3/%2.1/%2+" DirectoryIndex index.php index.html index.htm default.html default.htm home.html default.php home.php </VirtualHost> 

但是这是服务器的结果:

 Error: Apache shutdown unexpectedly. This may be due to a blocked port, missing dependencies, improper privileges, a crash, or a shutdown by another method. Press the Logs button to view error logs and check the Windows Event Viewer for more clues If you need more help, copy and post this entire log window on the forums 

有什么更多的信息吗?

尝试在虚拟主机configuration中添加acl,也许一些全局指令拒绝访问:

 <Directory "E:/Web Development Projects/"> Order deny, allow Require all granted </Directory> 

如果apache版本<= 2.4,用“全部允许”取代“要求全部授予”。

希望能帮助到你。

为了他人的利益,我也有这个问题,我的解决scheme是不同的:

1)确保您没有.htaccess或包含来自httpd.conf(或类似的)的conf文件覆盖任何指令。 注释掉任何include指令是肯定的。

2)你是否试图从你的/home目录提供内容? 别。 或者,如果您必须在您的主目录上设置chmod -R +x