不允许使用AuthType /在apache2.conf中要更改什么以允许.htaccess

时间:2015-04-10 09:50:44

标签: apache .htaccess authentication configuration

我尝试添加.htaccess(使用基本身份验证),但我收到500内部服务器错误,日志显示:/var/www/html/pgr/.htaccess: AuthType not allowed here 所以很清楚这个问题是什么,但我不知道如何在apache2.conf中修复它

我认为这是相关部分(从我的conf中复制)。我已经尝试将AllowOverride设置为AuthConfig,当然重新启动了apache2服务器,但它仍然无法正常工作。有人能告诉我还有什么需要改变吗?

<Directory />
        Options FollowSymLinks
        AllowOverride AuthConfig
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride AuthConfig
        Require all granted
</Directory>

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride AuthConfig
        Require all granted
</Directory>



#<Directory /srv/>
#       Options Indexes FollowSymLinks
#       AllowOverride None
#       Require all granted
#</Directory>




# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
        Require all denied

0 个答案:

没有答案