Odd problem with mod_authn_dbd and mysql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have been attempting for a day and a half now to replace an apache2 installation with mod_auth_mysql with an apache2.2 installation with mod_authn_dbd and the mysql driver. I won't rehash all the compiling issues here*, but after no small frustration I have the following:

A freshly compiled tree for httpd-2.2.4 in /usr/local/apache2, a fresh perl build and a static build of mod_perl-2.0.3, and now a fresh build of mysql in /usr/local/mysql-5.0.33 (this all has to run in parallel with a customer-facing support system on a box that is otherwise our dev machine). I rebuilt apr-utils with the mysql driver and installed that in the apache path, and the server doesn't balk at the DBDriver mysql configuration.

* OK, I'll rehash one compiling issue here. I'm not going to rant about open source licensing conflicts, but I'll rant that if you're going to have an open source licensing conflict, and you're also going to have support for a database people might reasonably expect to work with a basic compile, the INSTALL.MySQL file that tells you why the mysql driver isn't there should be at the TOP LEVEL of the tree, not buried in srclib/apr-util. Especially when people who don't do a lot of apache-specific compiling might not be familiar with apr and apr-util or know why they should be looking. It should be documented better on, say, the page for mod_dbd too, right after the sentence reading, "For example, DBDriver mysql will select the MySQL driver in apr_dbd_mysql.so." It won't do that if you haven't got it installed, and you haven't got it installed unless you've spent a couple hours on google before you stumble on one of seven pages (one in Japanese and one in Hungarian) that lead you to a post where somebody says how to find the driver. But I digress.

Anyway, back on topic: I have a single vhost (well, two, but once I get the one working I can do the other the same way) that runs PHP and has been using mod_auth_mysql under apache2. I have the following auth* modules loading, along with dbd:


LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_user_module    modules/mod_authz_user.so
#LoadModule authz_host_module modules/mod_authz_host.so #(loaded in another config file)
LoadModule dbd_module           modules/mod_dbd.so
LoadModule authn_dbd_module     modules/mod_authn_dbd.so


And the following global config:
DBDriver mysql
DBDParams "host=localhost user=<redacted> pass=<redacted> dbname=<redacted>" DBDPrepareSQL "SELECT encrypt(password) FROM <redacted> WHERE login_id = %s" passquery
DBDPersist off


And the vhost looks like this:
<VirtualHost *:80>
        ServerName blog.<redacted>.com
        <Directory "/home/httpd/blog/wordpress">
                AuthType Basic
                AuthName "Redacted Technology"
                AuthBasicProvider dbd
                AuthDBDUserPWQuery passquery
                Require valid-user
        </Directory>
</VirtualHost>

The mysql server log, however shows just this:

070203  2:30:51    5166 Connect     <redacted>@localhost on <redacted>
                   5166 Prepare     [1]
                   5166 Quit

And the vhost error log has this:
[Sat Feb 03 02:30:51 2007] [error] [client <my-ip>] No DBD Authn configured!

The query never gets sent to the DB. If I take out the DBDPrepareSQL line and put the query itself in for AuthDBDUserPWQuery, the server logs are even shorter: there's no 'Prepare' line in the mysql log. Just a 'Connect' followed immediately by a 'Quit'.

I've checked the username and password six ways from Sunday. If I put those same parameters into a perl script and run it I get back the encrypted password. I know it's at least connecting to the DB because I see it in the logs. Why isn't this query processing?


                                   - e


                     "All ages will be allowed to rock."




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux