2

I'm trying to block a subdirectory on my website that is open to the public. Nothing I've tried has been successful. Is this section from my conf enough to determine what's wrong?

This is on Apache 2.4.

<Directory /var/www/vhosts/website.example>
  AllowOverride None
</Directory>
<Directory /var/www/vhosts/website.example/private>
  AllowOverride None
  <RequireAny>
    Require ip 1.2.3.4
    Require ip 5.6.7.8
  </RequireAny>
</Directory>

Update: This issue has been solved. I stupidly forgot to include "httpdocs" in both of the Directory lines. After correcting that error the access by IP works as expected.

0

Issue was a dumb mistake. I forgot "httpdocs" in the Directory paths. After that fix, access control worked as expected.

<Directory /var/www/vhosts/website.example/httpdocs>
  AllowOverride None
</Directory>
<Directory /var/www/vhosts/website.example/httpdocs/private>
  AllowOverride None
  <RequireAny>
    Require ip 1.2.3.4
    Require ip 5.6.7.8
  </RequireAny>
</Directory>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.