GrepBoard/Manuals
605 manuals ·

Fix Apache 403 AH01630 with Require all granted

·Tested on Ubuntu 24.04.5 · Apache 2.4.58 (temporary instance on port 18701)·Test scope ↓·7 steps

One error.log line explains a 403. Fix AH01630 with Require, see why 2.2-style Order/Allow fails on 2.4, and tell AH01630 from AH01797 and AH00035.

error.log shows AH01630: client denied by server configuration: /srv/site/blocked/ and the browser shows 403 Forbidden. The Require rules for that path did not let the client through. The output below comes from Apache 2.4.58 running on 127.0.0.1:18701; paths and timestamps are shortened.

[1] Find the AH code in error.log at the time of the 403. Each code has a different cause, so read this line first. The file location is the ErrorLog value in your config.

console
# grep -E 'AH01630|AH01797|AH00035' /var/log/apache2/error.log | tail -n 5

[2] AH01630 carries the [authz_core:error] module tag, and the path at the end is the denied directory. The access log records the same request as 403.

output
[authz_core:error] [pid …] [client 203.0.113.7:45130] AH01630: client denied by server configuration: /srv/site/blocked/203.0.113.7 - - [02/Nov/2026:14:44:59 +0900] "GET /blocked/ HTTP/1.1" 403 199

[3] Find the Require that applies to that path. If you don't know whether it comes from <Directory>, <Location> or .htaccess, search the whole config with grep -rn Require. In the test, the top level denied everything and only one directory was opened.

console
# grep -rn 'Require' /etc/apache2/ --include=*.conf
/etc/apache2/apache2.conf
<Directory />    AllowOverride None    Require all denied</Directory>

[4] Add Require all granted to the directory you want to serve. To allow only certain addresses, use Require ip. With only Require ip 203.0.113.0/24, a request from 127.0.0.1 was denied with AH01630 in the test.

/etc/apache2/conf-available/site.conf
<Directory /srv/site/blocked>    Require all granted</Directory>

[5] Check the syntax and reload gracefully. graceful does not cut off requests in progress.

console
# apachectl configtestSyntax OK# apachectl graceful$ curl -s -o /dev/null -w '%{http_code}\n' http://localhost/blocked/200

[6] If the config was carried over from 2.2, look for leftover Order and Allow. On 2.4 they are only understood when mod_access_compat is loaded; otherwise the config test fails.

output
AH00526: Syntax error on line 2 of /etc/apache2/conf-available/old.conf:Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration

Loading mod_access_compat removes the syntax error, but with Require all denied higher up you still get 403. In the test, <Directory /> had Require all denied and a subdirectory had only Order allow,deny + Allow from all; the request was denied with AH01630. With the parent's Require line removed, the same config returned 200. Replacing the old directives with Require removes the problem.

2.22.4
Order allow,deny + Allow from allRequire all granted
Order deny,allow + Deny from allRequire all denied
Allow from 203.0.113.0/24Require ip 203.0.113.0/24

The official upgrade guide also discourages mixing old directives with Require: migrate everything at once, or keep only old directives (Upgrading to 2.4).

[7] If the 403 carries a different code, the cause is elsewhere.

CodeMessageCause
AH01630client denied by server configurationa Require rule denied it
AH01797client denied by server configurationan Order/Deny rule (mod_access_compat) denied it
AH00035access to … denied … because search permissions are missing on a component of the pathfilesystem permissions

AH01630 and AH01797 share the same message, so tell them apart by the code. AH00035 appeared on a chmod 000 directory even with Require all granted. For that one, check that the Apache user (www-data on Ubuntu) has x on every directory in the path with namei -l /srv/site/blocked/index.html.

Analyze your Apache log in the browser ↗ — nothing is uploaded.

Check it with the HTTP status codes tool ↗ — calculated in your browser.

#apache#403#require#access-control