使用 Apache 的虚拟机服务,出现 500 internal error。查看 error_log,看到如下报错内容:
[Fri Oct 11 00:17:46 2019] [crit] [client 124.64.30.156] configuration error: couldn't perform authentication. AuthType not set!:
然后httpd.conf中的代码:
<VirtualHost *:80>
DocumentRoot "/htdocs/tu/web"
ServerName localhost:80
ErrorLog logs/www.tu.com.error.log
CustomLog logs/www.tu.com.access.log common
<Directory "/htdocs/tu/web">
Options Indexes FollowSymLinks ExecCGI
AllowOverride all
allow from all
Require all granted
</Directory>
</VirtualHost>
百度一下,说是发现 “Require all granted” 指令只能用于 Apache 2.4,现在用的是Apache 2.2,。
只需要将 Require all granted 替换一下:
Order allow,deny
Allow from all