【问题标题】:Getting Apache 2.4 and mod_authn_dbd to work with a Wordpress user database让 Apache 2.4 和 mod_authn_dbd 与 Wordpress 用户数据库一起工作
【发布时间】:2019-07-26 20:40:29
【问题描述】:

有没有人设法使用 Wordpress wp_users 表作为 apache 的 mod_authn_dbd 的输入?这曾经适用于 apache 2.2 mod_auth_mysql,它有

Auth_MySQL_Encryption_Types PHPPass PHP_MD5

但经过大量搜索,我仍然无法理解如何使 mod_authn_dbd 与它从 wp_users 表中获得的“$P$B / md5”密码匹配。

这是我开始使用的基本配置:

DBDriver mysql
DBDParams "dbname=wp_test host=127.0.0.1 port=3306 user=root pass=rootpass"
DBDMin  2
DBDKeep 4
DBDMax  10
DBDExptime 300

Alias /test /home/test/test
<Directory "/home/test/test">
    Options +Indexes
    AuthType Basic
    AuthName "Authentication required"
    AuthBasicProvider dbd
    AuthDBDUserPWQuery "SELECT user_pass as password FROM wp_users WHERE user_login = %s"
    Require valid-user
</Directory>

我得到的错误是

[auth_basic:error] [pid 14812] [client 192.168.0.2:57126] AH01617: user test: authentication failure for "/test/": Password Mismatch

因此很明显 apache 使用与 wordpress 不同的哈希格式 - 但是有没有办法将这两种格式匹配起来以进行所需的比较?

【问题讨论】:

    标签: wordpress apache mod-auth


    【解决方案1】:

    实际上,解决方案是安装一个 WP 插件,如 PHP 原生密码哈希 - 将密码更改为 bcrypt,而 bcrypt 反过来又被 apache 识别。

    【讨论】:

      猜你喜欢
      • 2018-01-26
      • 1970-01-01
      • 2015-01-01
      • 2017-05-08
      • 2011-04-02
      • 2020-05-20
      • 1970-01-01
      • 2012-04-13
      • 1970-01-01
      相关资源
      最近更新 更多