的.htaccess / htpasswd的500内部服务器错误 [英] .htaccess/.htpasswd 500 Internal Server Error

查看:376
本文介绍了的.htaccess / htpasswd的500内部服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阻止一个文件夹的.htaccess,这是我以前从来没有使用过,而且我遇到了一些麻烦。下面是我的

I'm working on blocking a folder with .htaccess, which I've never used before, and I'm having some trouble. Here's what I have

的.htaccess(位于我想阻止的文件夹中):

.htaccess (located in the folder I want blocked):

AuthName "Username and password required"
AuthUserFile /.htpasswd 
Require valid-user
AuthType Basic

htpasswd的(位于root,密码在实际的文件加密):

.htpasswd (located at root, password is encrypted in actual file):

   tim:blah

我得到这个500内部服务器错误,我想不出为什么。

I'm getting 500 Internal Server errors with this and I can't figure out why.

推荐答案

最可能的问题是这一行:

Most likely problem is this line:

AuthUserFile /.htpasswd 

此行​​应提供完整的文件系统路径到密码文件如:

This line should provide full filesystem path to the password file e.g.

AuthUserFile /var/www/.htpasswd 

要发现你的文件系统路径,你可以创建一个包含PHP文件

To discover your filesystem path, you can create a PHP document containing

回声$ _ SERVER ['DOCUMENT_ROOT'];

这篇关于的.htaccess / htpasswd的500内部服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆