I have a problem with basic auth in apache 2.4. I have these lines:

<VirtualHost *:80>
    ServerAdmin email@email.com
    DocumentRoot /var/www/html/foo
    ServerName my.domain.com

<Directory /var/www/html/foo/>
        Options FollowSymLinks
        Require all granted
        DirectoryIndex index.php
        AuthType Basic
        AuthName "Authentication Required"
        AuthUserFile "/etc/httpd/.htpasswd"
        Require valid-user


Authentication is bypassed and shows the site without a password request.


Your configuration is granting access from any address.

You need to remove the line require all granted.


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.