我已经阅读了许多StackOverflow和其他人的相关权限的post,不明白为什么我的Windows 2008上的Apache2.4的虚拟主机似乎工作不一致。 主站点正在运行Drupal,另一个本质上是它的一个克隆,我想在Apache的文档中以8080端口运行。
在httpd.conf中有
Listen 80 Listen 8080
80端口的工作,但8080的返回403错误页面。
<VirtualHost *:80> DocumentRoot C:/Server/DOM ServerName example.edu <Directory C:/Server/DOM> Options FollowSymlinks AllowOverride All Require all granted </Directory> </VirtualHost> <VirtualHost *:8080> DocumentRoot C:/Server/uat ServerName example.edu <Directory C:/Server/uat> Options FollowSymlinks AllowOverride All Require all granted </Directory> </VirtualHost>
由于这是Apache 2.4,需要所有授予是必需的。 最上面的一个工作,但最下面的一个没有。 我比较了每个目录的权限,没有看到任何区别。 .htaccess是从工作的复制。
Apache在错误日志中返回:
AH01797: client denied by server configuration: C:/Server/uat/
我看到的唯一线索是当我删除端口80的虚拟主机,并运行https.exe -S
正如您所看到的,它正在拉入默认服务器并识别虚拟主机的configuration。 我没有看到任何错误,但显然我所做的是错误的。 请告诉我接下来应该检查什么。
C:\Users\wattsg>c:\Apache24\bin\httpd.exe -S VirtualHost configuration: *:8080 example.edu (C:/Apache24/conf/extra/httpd-v hosts.conf:25) ServerRoot: "C:/Apache24" Main DocumentRoot: "C:/Server/DOM" Main ErrorLog: "C:/Server/DOM/logs/error.log" Mutex ssl-stapling-refresh: using_defaults Mutex rewrite-map: using_defaults Mutex ssl-stapling: using_defaults Mutex ssl-cache: using_defaults Mutex default: dir="C:/Apache24/logs/" mechanism=default PidFile: "C:/Apache24/logs/httpd.pid" Define: DUMP_VHOSTS Define: DUMP_RUN_CFG
我也检查了Windows Server以确保Apache24的入站端口对所有人都是开放的。
这涉及到如何在Apache 2中设置虚拟服务器的默认值。在httpd.conf文件中,我读到默认服务器将被任何虚拟服务器覆盖。 我误解了。 httpd.conf中的configuration定义了默认值。 虚拟服务器设置可以单独更改它们。 我的第一个错误是,在这个文件中定义的主要的根网站统治。 这就是为什么它总是出现。 我的第二个问题是,即使我正确定义了目录规则,我想。 即使我使用了Apache 2.4 Required All Granted,它仍然拒绝了许可。 这个调整,我已经在主要的conf文件中设置,允许它运行。 我希望从我读过的东西中获得安全。
全部允许
要求所有授予