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

本文翻译自: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>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值