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