阿帕奇2.4" ..认证失败..:密码不匹配"不匹配、阿帕奇、密码、QUOT

2023-09-02 00:49:54 作者:別扯、扯多了都是事故

我在Windows Server 2008 R2运行Apache 2.4。我试图用密码保护的子目录,并成功地在Apache 2.0中这样做了。升级后,我把Apache的建议,并在尝试把在httpd.config认证配置。我允许密码文件,一切的阅读似乎是为了,但是当我测试它,我得到了以下错误:

[周一19年4月1日:58:36.438476 2013] [auth_basic:错误] [PID 3984:TID 788] [客户xxx.yyy.254.2:49253] AH01617:用户主:为/受限/文件验证失败。拉链:密码不匹配

不过,我知道,我发送了正确的密码。请参阅下面的我的配置,有任何意见是有益的。

 <目录C:/ WWW / MYDIR /受限制>
    #AllowOverride项AuthConfig
    #Order允许,拒绝
    #Allow所有
    与AuthType基本
    AuthName指令限制
    的AuthUserFileC:/ WWW / MYDIR /密码/通行证
    需要有效的用户
< /目录>
<目录C:/ WWW / MYDIR>
    要求所有批准
< /目录>
<虚拟主机*:80>
    SERVERADMIN管理@ .COM
    的DocumentRootC:/ WWW / MYDIR
    服务器名称fakeurl.com
    错误日志C:/www/mydir/logs/error.log
    的CustomLogC:/www/mydir/logs/accesslog/access.log共同
< /虚拟主机>
<虚拟主机*:80>
    SERVERADMIN管理@ .COM
    的DocumentRootC:/ WWW / MYDIR
    服务器名称www.fakeurl.com
    错误日志C:/www/mydir/logs/error.log
    的CustomLogC:/www/mydir/logs/accesslog/access.log共同
< /虚拟主机>
 

解决方案

我有同样的问题,被我逼疯了最后一个小时。我可以证实,史蒂夫的建议,在命令行输入密码的工作 - 所以在我的情况的htpasswd -b的密码文件的用户的密码的伎俩

这里是Apache相关的bug报告。

I am running Apache 2.4 in Windows Server 2008 R2. I am attempting to password protect a subdirectory and successfully did so in Apache 2.0. After upgrading I took Apache's advice and am attempting to put the authentication config in httpd.config. I am allowing the reading of the password file and everything appears to be in order, but when I test it I get the following error:

[Mon Apr 01 19:58:36.438476 2013] [auth_basic:error] [pid 3984:tid 788] [client xxx.yyy.254.2:49253] AH01617: user master: authentication failure for "/restricted/file.zip": Password Mismatch

However, I know that I am sending the correct password. See below for my config, any comments are helpful.

<Directory "C:/www/mydir/restricted">
    #AllowOverride AuthConfig
    #Order allow,deny
    #Allow from all
    AuthType Basic
    AuthName Restricted
    AuthUserFile "C:/www/mydir/passwords/pass"
    Require valid-user
</Directory>  
<Directory "C:/www/mydir">
    Require all granted
</Directory>  
<VirtualHost *:80>
    ServerAdmin admin@.com
    DocumentRoot "C:/www/mydir"
    ServerName "fakeurl.com"
    ErrorLog "C:/www/mydir/logs/error.log"
    CustomLog "C:/www/mydir/logs/accesslog/access.log" common
</VirtualHost>  
<VirtualHost *:80>
    ServerAdmin admin@.com
    DocumentRoot "C:/www/mydir"
    ServerName "www.fakeurl.com"
    ErrorLog "C:/www/mydir/logs/error.log"
    CustomLog "C:/www/mydir/logs/accesslog/access.log" common
</VirtualHost>

解决方案

I just had the same issue, was driving me nuts for the last hour. I can confirm that Steve's suggestion to enter the password in the command line works - so in my case "htpasswd -b passwordfile user password" did the trick.

Here is the relevant bug report at Apache.