admin 发表于 2019-10-12 18:14:30

Apache 报错: couldn't perform authentication. AuthType not set!: /

使用 Apache 的虚拟机服务,出现 500 internal error。查看 error_log,看到如下报错内容: configuration error:  couldn't perform authentication. AuthType not set!:conf.d/httpd-vhost.conf 中 vhost 配置的内容如下:<VirtualHost *:80>
        ServerName web1.cnblackhat.com
        ProxyVia on
        ProxyRequests Off
        ProxyPreserveHost On
        <Proxy>
Require all granted
        </Proxy>
        ProxyPass / http://172.31.225.243:8080/
        ProxyPassReverse / http://172.31.225.243:8080/
        <Location />
Require all granted
        </Location>
</VirtualHost>
搜索问题,寻找解决时,发现 “Require all granted” 指令只能用于 Apache 2.4。

httpd -v ,发现自己在使用的是 Apache 2.2.# httpd -v
Server version: Apache/2.2.15 (Unix)
Server built:   Jun 19 2018 15:45:13
只需要将 Require all granted 替换为如下内容即可:Order allow,deny
Allow from all最后成功访问:

页: [1]
查看完整版本: Apache 报错: couldn't perform authentication. AuthType not set!: /