且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

htaccess的给予500 - 内部服务器错误

更新时间: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上。
  • is this technique supported by the server? (ask your provider or admin)
  • is 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.
  • change the group-file to 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.
  • change the case of your require to 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/.