我安装了 WampServer 2,并且在我的计算机上创建了一个名为 test 的别名,该别名指向目录 g:/test/。
但是,当我尝试访问 localhost/test/时,我不断收到 403 错误
这是由我的 httpd.conf 中的这些行引起的(如果我注释掉这些行,则会加载)
<Directory />
AllowOverride none
Require all denied
</Directory>
我的测试配置如下:
Alias /test/ "g:/test/"
<Directory "g:/test/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
如何覆盖 test.conf 文件中的“要求全部拒绝”以阻止 403 错误?
错误日志显示: [Sun Dec 09 18:51:23.757803 2012] [authz_core:error] [pid 5128:tid 884] [client::1:50622] AH01630:客户端被服务器配置拒绝:G:/test/
访问日志显示: ::1 - - [09/Dec/2012:18:51:23 +0000] "GET/test/HTTP/1.1"403 207
最佳答案
尝试替换已弃用的:
Order allow,deny
Allow from all
作者:
Require all granted
仅关注Apache >= 2.4 。不过,我建议禁用 mod_access_compat(LoadModule 行)以避免 Order/Allow/Deny 与 Require 发生冲突。
关于Apache 403 错误 WampServer 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13790634/