Apache 2.4基本認証は機能しません。

Apache 2.4基本認証は機能しません。

Apache 2.4の基本認証に問題があります。次の行があります。

<VirtualHost *:80>
    ServerAdmin [email protected]
    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
</Directory>

</VirtualHost>

認証がバイパスされ、パスワードを要求せずにサイトが表示されます。

ベストアンサー1

あなたの設定はすべてのアドレスからのアクセスを許可しています。

この行を削除する必要がありますrequire all granted

おすすめ記事