3

我安装了 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 文件中的 Require all denied 以停止 403 错误?

错误日志显示:[Sun Dec 09 18:51:23.757803 2012] [authz_core:error] [pid 5128:tid 884] [client ::1:50622] AH01630: client denied by server configuration: G:/test/

访问日志读取: ::1 - - [09/Dec/2012:18:51:23 +0000] "GET /test/ HTTP/1.1" 403 207

4

2 回答 2

4

尝试替换已弃用的:

Order allow,deny
Allow from all

经过:

Require all granted

仅关注Apache >= 2.4。但是,我建议禁用 mod_access_compat(LoadModule 行)以避免与 Require 发生 Order/Allow/Deny 冲突。

于 2012-12-09T19:01:38.517 回答
0

选项索引 FollowSymLinks MultiViews AllowOverride all Allow from all #Require local Require all grant

以上文件注释#Require local add extra Require all grant

解决了

于 2016-01-21T09:45:05.063 回答