Fix Apache 403 AH01630 with Require all granted
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.
# 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.
[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.
# grep -rn 'Require' /etc/apache2/ --include=*.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.
<Directory /srv/site/blocked> Require all granted</Directory>[5] Check the syntax and reload gracefully. graceful does not cut off requests in progress.
# 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.
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 configurationLoading 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.2 | 2.4 |
|---|---|
Order allow,deny + Allow from all | Require all granted |
Order deny,allow + Deny from all | Require all denied |
Allow from 203.0.113.0/24 | Require 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.
| Code | Message | Cause |
|---|---|---|
AH01630 | client denied by server configuration | a Require rule denied it |
AH01797 | client denied by server configuration | an Order/Deny rule (mod_access_compat) denied it |
AH00035 | access to … denied … because search permissions are missing on a component of the path | filesystem 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.