Random Tech Thoughts

The title above is not random

Mod_auth_mysql & Apache 2.2

I’ve been painfully battling for several days to get mod_auth_mysql-3.0.0 to work with apache 2.2 these days. I googled a lot and had seen many people having problem about this. The configuration is all right but many people including me got the following error message from the error log

[error] Internal error: pcfg_openfile() called with NULL filename [error] [client 127.0.0.1] (9)Bad file descriptor: Could not open password file: (null)

And at last, by accident, with the help of xampp, I finally find out the cause of the problem. It’s all about the compatibility between different versions of software. My conclusion is that mod_auth_mysql works well with apache 2.0 but not apache 2.2. In fact you will have trouble with compiling mod_auth_mysql against with apache 2.2. I myself failed to compile it because of compile error. What I used with apache 2.2 was a module extracted from an rpm package. Though I started apache with out any problem with the precompiled module, the authentication doesn’t work and I got the above error message.

While I was trying xampp under Linux I found the module is not contained while the windows version contains one. Then I searched xampp addon and find that there is a precompiled mod_auth_mysql but is only for xampp 1.5.0 which using apache 2.0.55. After that, I tried apache 2.0.59 and the module compiles and every thing works.

For those who want to use mod_auth_mysql with apache 2.2, you may use a patch from Andrew’s diary, and you many need to add additional directive “AuthUserFile /dev/null”. To checkout more, see this thread in Fedora Forum.

Comments