We need to have an IP protected Apache. So only a couple of IPs allowed for the whole server. Rest needs to be blocked. However, since all other IPs are blocked, even the custom error documents are blocked?! I've even chmoded these files to 777. My Directory code is below. Welcome any thoughts on how at least the 400.htm
and 404.htm
can be "allowed" for everyone so they can show up. Thanks.
<VirtualHost *:80>
DocumentRoot /opt/public
ServerName xyz.com
<Directory /opt/public>
AllowOverride ALL
Require all granted
Options -Indexes
Order Deny,Allow
Deny from All
Allow from 99.99.0.0/16
Allow from 88.88.0.0/16
ErrorDocument 403 /opt/public/400.htm
ErrorDocument 404 /opt/public/404.htm
<Files 400.htm>
<RequireAll>
Require all granted
Require not env blockAccess
</RequireAll>
</Files>
<Files ~ "404\.htm$">
<RequireAll>
Require all granted
Require not env blockAccess
</RequireAll>
</Files>
</Directory>
</VirtualHost>
Files
blocks?Order
andDeny
mixed withRequire
. See: httpd.apache.org/docs/current/upgrading.html#accessblockedAccess
to not be set to access those files. I'm not sure what would set that variable or why you include that requirement.