server - Apache 2: 'AH01630: client denied by server configuration'

标签 server apache2 apache2.4

尝试通过浏览器访问本地主机时出现此错误。

AH01630: client denied by server configuration

我使用以下方法检查了我的网站文件夹权限:

sudo chmod 777 -R *

这是我的配置文件:

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /home/user-name/www/myproject
<Directory />
    Options FollowSymLinks
    AllowOverride all
    Allow from all
</Directory>

<Location />
  Allow from all
  Order Deny,Allow
</Location>

<Directory  /home/user-name/www/myproject/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order allow,deny
    Allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    AllowOverride all
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride all
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

最佳答案

如果您使用的是 Apache 2.4

您必须检查允许和拒绝规则

查看http://httpd.apache.org/docs/2.4/upgrading.html#access

In 2.2, access control based on client hostname, IP address, and other characteristics of client requests was done using the directives Order, Allow, Deny, and Satisfy.

In 2.4, such access control is done in the same way as other authorization checks, using the new module mod_authz_host.

新指令是 Require :

2.2配置:

Order allow,deny
Allow from all

2.4配置:

Require all granted

另外,不要忘记在这些更改后重新启动 apache 服务器 (# service httpd restart)

关于server - Apache 2: 'AH01630: client denied by server configuration',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18392741/

相关文章:

linux - 已授予权限,但 www-data 仍无法在文件夹中写入文件

apache 通过直接点击 url 来阻止查看用户的内容

android - 如何使用 Jersey 在 Android 应用程序中托管 Rest API 服务器?

perl - 使用 Plack::Handler::Apache2 与 Apache2 的 PSGI 应用程序导致 'not found'

php - 414 URI 太长。但不总是

Apache 2.4.29 和 mod_jk 1.2.42 没有转发到 tomcat

sql-server - 我如何在两个服务器中进行通信。我想要从 A 服务器到 B 服务器上的一些数据。如果我通过 Web 套接字进行通信,如果是,那么如何?

c - C中的RTSP服务器没有客户端响应

authentication - 是否可以将 Apache 基本身份验证设置为锁定目录(一个文件除外)?

.htaccess - WordPress 网站子目录中的 Yii2 应用程序 : cannot enable pretty urls