Apache 403 “AH01630: client denied by server configuration”: the fix
Updated 18 November 2026 · By Brent Alexis
Short answer: AH01630 means an Apache access rule refused the request, so the visitor gets 403 Forbidden. Most of the time the folder was never allowed: Apache 2.4 denies everything by default and only opens the folders you grant. Add a <Directory> block with Require all granted for your DocumentRoot (and for every Alias target), test, and reload. On Debian and Ubuntu, only /var/www and /usr/share are granted out of the box.
Tested on the official httpd Docker image and Debian 12 (both Apache 2.4.71), with ProxyForge's own Config Generator output: 33 checks. How it's tested
- What the log line looks like
- The fix: grant the folder
- Debian and Ubuntu: why /var/www works and /srv doesn't
- Alias folders need their own grant
- Old Apache 2.2 lines (Order, Allow, Deny)
- Require ip behind a proxy or Cloudflare
- A Require line in .htaccess
- When AH01630 is normal
- 403s that aren't AH01630
What the log line looks like
The browser only shows 403 Forbidden. The reason is in Apache's error log (on Debian and Ubuntu, /var/log/apache2/error.log). This is the line Debian 12 wrote for a site in /srv/example.com:
[authz_core:error] [pid 72:tid 80] [client 127.0.0.1:40526] AH01630: client denied by server configuration: /srv/example.com/
The path at the end is the folder or file that was refused. authz_core is the module that runs Require rules, which tells you a Require rule said no, not the file system.
sudo tail -n 20 /var/log/apache2/error.log
The fix: grant the folder
With DocumentRoot /srv/example.com and no <Directory> block for it, every page was a 403 with the line above. The official image's httpd.conf starts with <Directory /> AllowOverride none Require all denied </Directory>, and Debian's apache2.conf has the same rule, so any folder you don't open stays shut.
This is the Config Generator's static-site virtual host for that folder (HTTPS and Gzip unticked). The <Directory> block with Require all granted is the part that matters:
# Generated Apache virtual host — review paths before deploying
# Save as /etc/apache2/sites-available/example.com.conf (Debian/Ubuntu, then: sudo a2ensite example.com)
# or /etc/httpd/conf.d/example.com.conf (RHEL, Alma, Rocky, Fedora).
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /srv/example.com
<Directory /srv/example.com>
Options -Indexes
AllowOverride None
Require all granted
</Directory>
DirectoryIndex index.html
</VirtualHost>
Checked: it served the site from /srv/example.com with a 200 on the official image, and on a stock Debian 12 without touching apache2.conf. Then test and reload:
sudo apachectl configtest && sudo systemctl reload apache2
Debian and Ubuntu: why /var/www works and /srv doesn't
Debian 12's /etc/apache2/apache2.conf grants /usr/share and /var/www/, and ships a <Directory /srv/> block that is commented out. A site under /var/www works without its own grant; the same site under /srv gets AH01630. Uncommenting the /srv/ block fixed it in the lab, but it opens all of /srv for every site on the server. A <Directory> block in the site's own virtual host, like the one above, only opens that site's folder.
Debian 12 was tested; Ubuntu ships the same apache2.conf layout from the same Debian package.
Alias folders need their own grant
An Alias to a folder outside the granted ones is refused even when the main site works. With Alias /static /opt/static, /static/site.css was a 403, and the log named the real folder:
AH01630: client denied by server configuration: /opt/static/site.css
Adding a second block fixed it:
<Directory /opt/static>
Require all granted
</Directory>
Old Apache 2.2 lines (Order, Allow, Deny)
Tutorials written for Apache 2.2 use Order allow,deny and Allow from all. On Apache 2.4.71 those lines alone did not open the folder, even with mod_access_compat loaded (it's on by default in both the official image and Debian 12, so there was no error): the site was still a 403 with the same authz_core AH01630 line. Adding Require all granted fixed it. Apache's upgrading guide explains why: mod_access_compat “was created to support configurations containing only old directives”, and the stock 2.4 config already uses Require all denied, so one old block in it is a mix.
- With mod_access_compat turned off, the old lines stop Apache from starting:
Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration(see Apache “Invalid command”). - Mixing them is worse.
Require all grantedtogether with an oldDeny from allwas a 403, logged by the old module under a different code:[access_compat:error] ... AH01797: client denied by server configuration.
Fix: replace the old lines instead of adding to them. Apache's upgrading guide gives the matches:
| Apache 2.2 | Apache 2.4 |
|---|---|
Order allow,deny + Allow from all | Require all granted |
Order deny,allow + Deny from all | Require all denied |
Order Deny,Allow + Deny from all + Allow from example.org | Require host example.org |
(Lab-tested: the first row. The other two are from Apache's Upgrading to 2.4 page, checked 18 November 2026. For an IP address the 2.4 form is Require ip, below.)
Require ip behind a proxy or Cloudflare
Require ip checks the address the connection came from. Behind Cloudflare or a load balancer, that's the proxy, not the visitor, so an allowed visitor still gets AH01630. In the lab, Require ip 203.0.113.5 refused the request, and sending CF-Connecting-IP: 203.0.113.5 on its own didn't help. With mod_remoteip turned on and told to trust the proxy, the same header was let through and any other address in it was still refused:
RemoteIPHeader CF-Connecting-IP
RemoteIPInternalProxy 127.0.0.1 # the lab's stand-in proxy; use your proxy's address
For Cloudflare, tick Behind Cloudflare in the Config Generator: it writes RemoteIPHeader CF-Connecting-IP plus RemoteIPTrustedProxy lines for Cloudflare's published ranges. mod_remoteip was off by default in both servers tested; on Debian run sudo a2enmod remoteip.
A Require line in .htaccess
A Require all denied in .htaccess was ignored with AllowOverride None (the site loaded) and applied with AllowOverride All (403, AH01630). If AllowOverride is on for the folder, check its .htaccess files for Require lines.
When AH01630 is normal
Not every AH01630 is a problem. Apache's own default config refuses files starting with .ht: a request for /.htaccess got a 403 and logged AH01630: client denied by server configuration: /srv/example.com/.htaccess. Lines like that for .htaccess, .htpasswd or folders you deliberately closed come from scanners, and mean the rule is working.
403s that aren't AH01630
The browser shows the same 403 Forbidden for these, but the log says something else, and the fix is different:
| Log code | What it means | Fix |
|---|---|---|
AH01630 (authz_core) | A Require rule refused it | Grant the folder (above) |
AH01797 (access_compat) | An old Deny line refused it | Replace the 2.2 lines with Require |
AH00035 (core) | Apache's user can't read the folder: (13)Permission denied ... search permissions are missing on a component of the path | File permissions, not config: the lab folder was chmod 700 and owned by root |
AH01276 (autoindex) | A folder with no index file, and listings are off: No matching DirectoryIndex (index.html) found | Add the index file, or point DirectoryIndex at the right one |
Generate an Apache virtual host with the folder already granted →
How to use ProxyForge · FAQ: common errors · Guides · What's new · About