我正在尝试使用apache v2.4.7为我的网站设置非常基本的用户名/密码保护。我在我的网站conf文件中有以下内容:
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
DocumentRoot /var/my.site
DirectoryIndex index.html
<Directory /var/my.site>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
Options +ExecCGI
AddHandler cgi-script .pl
Require all granted
AuthType Basic
AuthName "Authentication Required"
AuthUserFile "/etc/my-site/.htpasswd"
Require valid-user
</Directory>
...
...但它在没有任何auth挑战的情况下为所有请求提供服务。我也尝试将auth选项放入他们自己的<Location>
块中,但它们是相同的。我自己还没有明确启用任何额外的身份验证模式,但我已经检查了auth_basic
,authn_core
,authn_file
和authz_user
mods,并且他们已经检查了这些模式。\ n&#39;全部启用。