Apache2:'AH01630:服务器配置拒绝客户端'

本文详细解析了在尝试通过浏览器访问localhost时遇到的Apache2 'AH01630:client denied by server configuration' 错误。提供了检查站点文件夹权限的方法,分析了配置文件设置,并给出了针对Apache2.4版本的解决方案,包括修改允许和拒绝规则,更新Require指令,以及确保DocumentRoot路径正确。

本文翻译自:Apache2: 'AH01630: client denied by server configuration'

I get this error when trying to access localhost via a browser. 尝试通过浏览器访问localhost时出现此错误。

AH01630: client denied by server configuration

I checked my site folder permissions using: 我使用以下方法检查了站点文件夹权限:

sudo chmod 777 -R *

Here is my configuration file: 这是我的配置文件:

<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>


#1楼

参考:https://stackoom.com/question/1FAn7/Apache-AH-服务器配置拒绝客户端


#2楼

If you tail the error log and reload the page, you should see some more information as to the exact problem. 如果拖尾错误日志并重新加载页面,则应该看到有关确切问题的更多信息。

Grab the environment variables so ${APACHE_LOG_DIR} will actually work... 抓住环境变量,以便$ {APACHE_LOG_DIR}实际上可以工作...

source /etc/apache2/envvars

Then tail and watch... 然后尾巴看...

tail -f ${APACHE_LOG_DIR}/error.log

#3楼

If you are using Apache 2.4 如果您使用的是Apache 2.4

You have to check allow and deny rules 您必须检查允许和拒绝规则

Check out http://httpd.apache.org/docs/2.4/upgrading.html#access 查看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. 在2.2中,使用指令Order,Allow,Deny和Satisfy完成了基于客户机主机名,IP地址和客户机请求其他特征的访问控制。

In 2.4, such access control is done in the same way as other authorization checks, using the new module mod_authz_host. 在2.4中,使用新模块mod_authz_host以与其他授权检查相同的方式完成这种访问控制。

The new directive is Require : 新指令为Require

2.2 configuration: 2.2配置:

Order allow,deny
Allow from all

2.4 configuration: 2.4配置:

Require all granted

Also don't forget to restart the apache server after these changes ( # service httpd restart ) 也不要忘记在这些更改后重新启动apache服务器( # service httpd restart


#4楼

Double check that the DocumentRoot path is correct. 仔细检查DocumentRoot路径是否正确。 That can cause this error. 那会导致这个错误。


#5楼

For all directories write Require all granted instead of Allow from all 对于所有目录,请写Require all granted而不是Allow from all 就像是

Update 更新资料

If the above doesn't work then also remove this below mentioned line: 如果上述方法不起作用,则还要删除下面提到的这一行:

Order allow,deny 订单允许,拒绝


#6楼

I made the same changes that ravisorg suggested to OSX 10.10 Yosemite that upgrades Apache to version 2.4. 我做了与ravisorg建议的OSX 10.10 Yosemite相同的更改,将Apache升级到了版本2.4。 Below are the changes that were added to http.conf. 以下是添加到http.conf中的更改。

<Directory />
    AllowOverride none
    Require all denied
</Directory>

<Directory /Volumes/Data/Data/USER/Sites/>
    AllowOverride none
    Require all granted
</Directory>
[Sun Jun 29 14:55:13.531112 2025] [core:error] [pid 27208:tid 1168] [client ::1:61472] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use &#39;LimitInternalRecursion&#39; to increase the limit if necessary. Use &#39;LogLevel debug&#39; to get a backtrace. [Sun Jun 29 14:56:16.227311 2025] [core:error] [pid 27208:tid 1148] [client ::1:61485] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use &#39;LimitInternalRecursion&#39; to increase the limit if necessary. Use &#39;LogLevel debug&#39; to get a backtrace. [Sun Jun 29 15:04:18.703894 2025] [core:warn] [pid 35516:tid 364] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run? [Sun Jun 29 15:04:18.862470 2025] [mpm_winnt:notice] [pid 35516:tid 364] AH00455: Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 configured -- resuming normal operations [Sun Jun 29 15:04:18.862470 2025] [mpm_winnt:notice] [pid 35516:tid 364] AH00456: Apache Lounge VS17 Server built: Oct 18 2023 13:03:18 [Sun Jun 29 15:04:18.862470 2025] [core:notice] [pid 35516:tid 364] AH00094: Command line: &#39;c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache&#39; [Sun Jun 29 15:04:18.873441 2025] [mpm_winnt:notice] [pid 35516:tid 364] AH00418: Parent: Created child process 37656 [Sun Jun 29 15:04:21.226512 2025] [mpm_winnt:notice] [pid 37656:tid 320] AH00354: Child: Starting 64 worker threads. [Sun Jun 29 15:07:19.452902 2025] [core:warn] [pid 29396:tid 396] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run? [Sun Jun 29 15:07:19.567596 2025] [mpm_winnt:notice] [pid 29396:tid 396] AH00455: Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 configured -- resuming normal operations [Sun Jun 29 15:07:19.567596 2025] [mpm_winnt:notice] [pid 29396:tid 396] AH00456: Apache Lounge VS17 Server built: Oct 18 2023 13:03:18 [Sun Jun 29 15:07:19.567596 2025] [core:notice] [pid 29396:tid 396] AH00094: Command line: &#39;c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache&#39; [Sun Jun 29 15:07:19.579564 2025] [mpm_winnt:notice] [pid 29396:tid 396] AH00418: Parent: Created child process 37736 [Sun Jun 29 15:07:21.852612 2025] [mpm_winnt:notice] [pid 37736:tid 332] AH00354: Child: Starting 64 worker threads. [Sun Jun 29 15:07:32.462402 2025] [core:error] [pid 37736:tid 1180] [client ::1:61597] AH00126: Invalid URI in request &#39;index.php&#39; &#39;GET /web/UserLogin/accountLogin HTTP/1.1&#39; [Sun Jun 29 15:07:50.674094 2025] [core:error] [pid 37736:tid 1176] [client ::1:61598] AH00126: Invalid URI in request &#39;index.php&#39; &#39;GET /web/UserLogin/accountLogin HTTP/1.1&#39; [Sun Jun 29 15:08:28.424576 2025] [core:warn] [pid 25176:tid 336] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run? [Sun Jun 29 15:08:28.539271 2025] [mpm_winnt:notice] [pid 25176:tid 336] AH00455: Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 configured -- resuming normal operations [Sun Jun 29 15:08:28.539271 2025] [mpm_winnt:notice] [pid 25176:tid 336] AH00456: Apache Lounge VS17 Server built: Oct 18 2023 13:03:18 [Sun Jun 29 15:08:28.539271 2025] [core:notice] [pid 25176:tid 336] AH00094: Command line: &#39;c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache&#39; [Sun Jun 29 15:08:28.574179 2025] [mpm_winnt:notice] [pid 25176:tid 336] AH00418: Parent: Created child process 12320 [Sun Jun 29 15:08:30.762870 2025] [mpm_winnt:notice] [pid 12320:tid 352] AH00354: Child: Starting 64 worker threads. [Sun Jun 29 15:09:23.908308 2025] [core:error] [pid 12320:tid 1184] [client ::1:61618] AH00126: Invalid URI in request &#39;index.php&#39; &#39;GET /web/Index/thinkPHP8 HTTP/1.1&#39;
最新发布
06-30
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值