错误:couldn’t perform authentication. AuthType not set!: /

2021年3月30日 | 分类: 【技术】

使用 Apache2.2 的虚拟机服务,打开网页报错:500 internal error。

查看 error_log,看到如下报错内容:

[shell] configuration error: couldn't perform authentication. AuthType not set!: [/shell]

原 vhost.conf 中配置内容如下:

[shell] <VirtualHost *:80> ServerName azon.baidu.dec DocumentRoot /home/www/default/azon <Directory "/home/www/default/azon"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require all granted </Directory> </VirtualHost> [/shell]

问题在于: “Require all granted” 指令只能用于 Apache 2.4。而当前使用的是 Apache 2.2.

只需要将 Require all granted 替换为如下内容即可:

[shell] Order allow,deny Allow from all [/shell]

参考:https://www.jianshu.com/p/7e94b819daf6