【发布时间】:2013-08-25 21:49:47
【问题描述】:
我在尝试通过浏览器访问本地主机时收到此错误。
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 吗?哪个路径给出了这个错误?
-
您似乎需要更新配置。看这里:httpd.apache.org/docs/2.4/upgrading.html#run-time
-
chmod 777是一个非常糟糕的习惯,即使(据说)只在示例中使用。 -
chmod 777 永远不是答案。