I edited my apache2.conf (on Ubuntu) to restrict access to all except from one IP, but I still can access from other IPs. Below is my configuration:
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require ip x.x.x.x
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require ip x.x.x.x
</Directory>
authz_core module is loaded, so is there something wrong? Thanks.
If none of the directives contained within the directive fails, and at least one succeeds, then the directive succeeds. If none succeed and none fail, then it returns a neutral result. In all other cases, it fails.`
– Mikhail Khirgiy Apr 12 '18 at 15:16RequireAllisn't being used in the question or in the answer. You're usingRequireAnywhich is the default behaviour (i.e. if you took out<RequireAny>and</RequireAny>from your answer it would make no functional difference) – Doug McLean Apr 12 '18 at 19:58<IfModule>wrapper implies that the contained directives are optional. @DougMcLean – MrWhite Sep 12 '18 at 18:25directory /for security reason." - Although, the OP is using the<Directory />container to restrict all access (AllowOverride None/Require all denied), not allow it, which is recommended. – MrWhite Sep 12 '18 at 18:33