Apache AH01624: <RequireAll> directive contains only negative authorization directives
Fix Apache AH01624 by adding the intended IP allowlist to RequireAll, keeping the exclusion in place, and checking the configuration before applying it.
AH01624: <RequireAll> directive contains only negative authorization directivesAH00014: Configuration check failedApache fails its configuration check when <RequireAll> contains only Require not ip. Keep the exclusion and add the address or range that should have access inside the same block.
[1] Find <RequireAll> in the configuration Apache is checking. If several virtual hosts serve the same path, start with the one you changed and the files it loads through Include. The command below uses the official httpd image's configuration directory. Use your own configuration directory on other installations.
$ grep -RnE --include='*.conf' '<RequireAll>|Require[[:space:]]+not[[:space:]]' /usr/local/apache2/confThe opening output came from placing this configuration in /repro/negative.conf and running httpd -t -c 'ServerName localhost' -c 'Include /repro/negative.conf'. The check exited with status 1.
<Location "/ops/"> <RequireAll> Require not ip 192.0.2.1 </RequireAll></Location>This rule denies a request from 192.0.2.1 and returns a neutral result for other addresses. For <RequireAll> to grant access, at least one rule must grant it and none can deny it. During the configuration check, Apache looks for a condition without the negation flag and logs AH01624 when it finds none. Require and RequireAll · httpd 2.4.71 configuration check source
[2] Keep a copy of the last working configuration and add the allowlist inside the block. This example allows 192.0.2.0/24 with an exception for 192.0.2.1. Replace both documentation addresses with the approved range and excluded address for your deployment.
<Location "/ops/"> <RequireAll> Require ip 192.0.2.0/24 Require not ip 192.0.2.1 </RequireAll></Location>| Example client address | Decision in this block |
|---|---|
192.0.2.24 | Allowed by the range and unaffected by the exclusion |
192.0.2.1 | Denied by the exclusion despite matching the range |
203.0.113.24 | Denied because it falls outside the range |
The table shows how this block evaluates requests. Check other configuration sections or virtual hosts that affect the same URL. Adding Require all granted would widen this block to allow every client outside the exclusion. Use it only for public paths where the access policy calls for that scope. Require ip and CIDR syntax · AuthMerging
[3] Run the same configuration check again. The test switched the included file and Apache reported the following result.
$ httpd -t -c 'ServerName localhost' -c 'Include /repro/allowlist.conf'Syntax OKFor a deployment, check the virtual host along with its included files. The command below applies the configuration to a running Apache instance. If Apache is already down, pass the configuration check and follow the startup procedure for your installation. apachectl configtest and graceful
# apachectl configtest && apachectl gracefulIf access changes in an unintended way, restore the last working configuration and repeat the check and apply command.
[4] Request the same path from a client in the allowed range and from an excluded client. Check for the normal application response from the allowed client and a 403 from the excluded client. If a client that should be allowed gets a 403 and the error log shows AH01630, the loaded configuration denied the request. Find the Require rules behind AH01630
Analyze your Apache log in the browser ↗ — nothing is uploaded.