Apache authentication using MySQL through mod_authn_dbd fails

I am trying to restrict access to a directory using basic user authentication: password stored in mysql database. After starting the Apache service with mod_authn_dbd enabled, it creates about 60 - 70 MySQL processes, all of them have a "sleep" command. However, these errors appear in the entire Apache log, and as a result of this error, authentication is interrupted:

[Mon Aug 19 21:38:15 2013] [error] (20014)Internal error: DBD: failed to initialise [Mon Aug 19 21:38:15 2013] [crit] (20014)Internal error: DBD: child init failed! [Mon Aug 19 21:38:15 2013] [error] (20014)Internal error: DBD: Can't connect to mysql 

I tried to configure the MySQL connection limits and DBD parameters to fix this, without success.

This is my current configuration with deleted information:

 <IfModule mod_authn_dbd.c> DBDriver mysql DBDParams "host=localhost port=3306 dbname=SITE_USERS user=DBUSER pass=DBPASS" DBDExptime 300 DBDMin 1 DBDMax 10 </IfModule> <Directory "/home/mysite/public_html/protected"> AuthCookieName CookieAuth AuthCookieBase64 On AuthType Basic AuthName "Registered User" AuthBasicProvider dbd AuthDBDUserPWQuery "SELECT password FROM users WHERE username = %s" Require valid-user AllowOverride None Order allow,deny Allow from all </Directory> 
+4
source share
1 answer

It seems you are facing Error # 45995 mod_authn_dbd conflict with php + mysql .

As described in the related entry , this is caused by a conflict between apache-apr-util mysql and the php mysql driver. You can either remove php-mysql if you are not using it, or if you want, you can downgrade apr and apr-util to version 1.3 or lower.

+2
source

Source: https://habr.com/ru/post/1497904/


All Articles