更新时间:2022-02-14 08:10:00
首先,请查阅错误日志(通常位于 /var/log/apache2/error.log
)查看错误的确切原因。
First of all, consult the error-log (usually located in /var/log/apache2/error.log
) to see the exact cause of the error.
如果你没有访问它,检查以下内容:
If you do not have access to it, check the following:
的AuthUserFile
是否正确?这似乎是缺少一个斜杠和目录是不寻常的。我会怀疑像的AuthUserFile /home/webuser/sitefolder/.htpasswd
。目录AuthGroupFile无
,而不是指向阿帕奇读的/ dev / null的
。想想的/ dev / null的
作为底少垃圾桶。这是不容易从那里得到任何东西,可能是一个原因服务器出现故障尝试。需要有效的用户而言
。它需要一个资本R上。AuthUserFile
correct? It seems to be missing a slash and the directory is unusual. I would have suspected something like AuthUserFile /home/webuser/sitefolder/.htpasswd
.AuthGroupFile None
instead of pointing apache to read /dev/null
. Think of /dev/null
as a bottom-less trashcan. It's not easy to get anything from there and might be a reason for the server to fail trying.Require valid-user
. It needs to be a capital R.要总结:
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /home/webuser/sitefolder/.htpasswd
AuthGroupFile None
Require valid-user
有关进一步信息,我建议 http://httpd.apache.org/docs/ 。
For further info, I recommend http://httpd.apache.org/docs/.