Apache不能识别密码保护的目录

我想在我的网站上密码目录/rutorrent 。 在那个目录下,我创build了这个.htaccess文件:

 AuthUserFile /home/whitey/sites/localhost/.htpasswd AuthName "Login to use rutorrent" AuthType Basic require valid-user 

然后我在/home/whitey/sites/localhost/有一个.htpasswd文件:

 whitey:f9kK77E4scRcI 

我已经使用在线.htpasswd生成器生成密码。 我重新启动了Apache,但是当我进入/rutorrent目录时,系统没有提示input密码。

在错误日志中也没有显示出来。

为了使Apache使用.htaccess文件,基本configuration必须指定允许您使用AllowOverride指令覆盖configuration。 此外,必须允许适当的覆盖types。 对于Auth *和Require指令,您必须至less有(也可以在列表中还有其他选项,或All ):

 AllowOverride AuthConfig 

设置为<Directory> .htaccess文件是在(或其上的目录,没有其他目录禁用该指令)