12

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?

1
  • It looks correct to me. Are you sure they isn't some other directive that's more specific with a Require all denied? Sep 24, 2013 at 7:25

5 Answers 5

5

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.

4

You have set up authorization, but no authentication. So while the 'Require all granted' will give all authenticated users access, your users don't actually authenticate.

2
  • 10
    So where should you set up authentification ? Not very clear ...
    – edi9999
    Nov 24, 2014 at 11:14
  • 2
    While technically correct, this doesn't answer the question. Require all granted specifically allows all access and doesn't need any authentication. There's no point to authenticating when you're metaphorically throwing the doors wide open. Mar 22, 2017 at 13:08
2

Since you're using the AllowOverride All directive, you may also have an .htaccess file in /path/to/project/. This one may contain an overriden directive.

Check also if you don't don't have some other parameter in a VHost for exemple.

1
  • I was struggling with this error. After lots of reviewing all Apache configuration files I found a .htaccess file with invalid content. None of the messages pointed to this. Apr 29, 2017 at 16:31
1

After having installed Wampserver 32, I have had the same issue of being rejected by Apache.

I have checked and try to modify the httpd.conf file in many ways for 3 days with no luck, going all around the Apache tutorials and Internet forums with the famous error:

AH01630: client denied by server configuration

I was quite sure I did not define any VirtualHost and none was to be seen in the httpd.conf file.

Finally, I configured the server for "debug" error file, which gave me the more interesting message:

AH01626: authorization result of Require local : denied

which in turn lead me to this post.

And there it was, hidden in the C:\wamp\bin\apache\apache2.4.18\conf\extra\httpd-vhosts.conf file: an undesired VirtualHost with an explicit "Require local" which of course rejected all my queries from outside the server.

Now, I have emptied this file until I may need any VirtualHost, and it works fine. In the end, I find it rather strange from Wampserver to not only pre-configure this file without notifying the user but to set the default value so that the "server" cannot serve anything.

1

This looks really old, but I came today after being desperate for 10minutes. It turned out: Directory and DocumentRoot to be different(misspelled). Maybe this will save some time to someone else :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .