Apache 2.4 "..authentication failure..:Password Mismatch"

标签 apache .htaccess authentication .htpasswd

我在 Windows Server 2008 R2 中运行 Apache 2.4。我试图用密码保护一个子目录,并在 Apache 2.0 中成功地这样做了。升级后,我接受了 Apache 的建议,并尝试将身份验证配置放在 httpd.config 中。我允许读取密码文件,一切似乎都井井有条,但是当我测试它时,出现以下错误:

[Mon Apr 01 19:58:36.438476 2013] [auth_basic:error] [pid 3984:tid 788] [client xxx.yyy.254.2:49253] AH01617:用户主:“/restricted/file”认证失败。密码不匹配

但是,我知道我正在发送正确的密码。请参阅下面的我的配置,任何评论都是有帮助的。

<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>

最佳答案

我刚刚遇到了同样的问题,在最后一个小时让我发疯。我可以确认史蒂夫在命令行中输入密码的建议有效 - 所以在我的情况下,“htpasswd -b passwordfile 用户密码”成功了。

Here是 Apache 的相关错误报告。

关于 Apache 2.4 "..authentication failure..:Password Mismatch",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15751242/

相关文章:

mysql - Apache 403 禁止允许来自所有 <Directory> - 虚拟主机

apache - 在 apache 配置上使用查询字符串设置引用 header

.htaccess - htaccess 将所有流量重定向到 https ://www

django - Django Authenticate返回无

c# - 如何加密密码并将其保存在 MySQL 数据库中。

angular - 由 aws API 制作的 HttpRequest 拦截器

php - Google Chrome 对缓存的审核

php - 这个 zend 框架路径是如何工作的?

.htaccess - htaccess QUERY_STRING urldecode

php - PHP 的 HTTP 身份验证究竟是如何工作的?