问题原文
原帖链接 · hairlessdev · CC BY-SA 3.0
I have a fresh install of Apache2 on Debian testing and configured a virtual host in a directory like this:
<Directory "/path/to/project">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
However it shows me a 403 Forbidden error when I access it and the error log shows:
[Mon Sep 23 22:07:57.249276 2013] [authz_core:debug] [pid 8599] mod_authz_core.c(802): [client 127.0.0.1:49057] AH01626: authorization result of Require all denied: denied
[Mon Sep 23 22:07:57.249349 2013] [authz_core:debug] [pid 8599] mod_authz_core.c(802): [client 127.0.0.1:49057] AH01626: authorization result of <RequireAny>: denied
[Mon Sep 23 22:07:57.249361 2013] [authz_core:error] [pid 8599] [client 127.0.0.1:49057] AH01630: client denied by server configuration: /path/to/project/some_file
Why is it showing "result of Require all denied: denied" if I'm using "Require all granted"?
They files are readable by any user and just in case I tried changing the owner to Apache (www-data) without luck. Also, the default host on http://localhost works normally and phpmyadmin in http://localhost/phpmyadmin works too.
All help I've found on the Internet is about replacing the Order directive with Require. I've already done that. What could be the problem now?
社区高分解答
原帖链接 · Doug · CC BY-SA 3.0
Here are two things to try:
1) Run apachectl -t to check the syntax of your file is valid.
2) Run apachectl -S to show which files are being parsed.
For example, you may be editing /usr/local/etc/apache2/2.4/httpd.conf and that's it right? ...but if you run apachectl -S you might see:
VirtualHost configuration:
*:80 localhost (/private/etc/apache2/extra/httpd-vhosts.conf:23)
ie. The virtual host is overriding your httpd.conf, and may contain its own Require all denied or similar.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
