mod_auth_mysql - compiles clean - doesn't work

soundguy

Well-Known Member
PartnerNOC
Oct 29, 2003
52
0
156
seattle
I've been trying (unsuccessfully) to install mod_auth_mysql on a Cpanel-Release/CentOS 4.1 box. It compiles clean and apxs seems to install correctly but any attempt to use the module in .htaccess throws the error Invalid command 'Auth_MYSQL', perhaps mis-spelled or defined by a module not included in the server configuration which leads me to believe it's not being loaded.

According to the docs, the correct statement in httpd.conf is

LoadModule mysql_auth_module modules/mod_auth_mysql.so

but since that directory doesn't exist, I have been using

LoadModule mysql_auth_module libexec/mod_auth_mysql.so

because that's where the module actually is, along with every other dynamic module on this box. I'm also unclear on where to put the line

AddModule mod_auth_mysql.c

Logic dictates that it would go at the end of the list of XXX.c statements, but at least one article I ran a cross in the wild stated that it needed to go at the top of that group or it would break .htaccess altogether. (I tried it at the bottom and everything did indeed stop working)

Lastly, the module is compiled to be active all the time, but I need to run more than one authorization scheme on this machine for a little while longer while I do some testing, so I need to turn it off in httpd.conf for now, but I can't figure out where (and how) to add Auth_MYSQL Off without causing an error in Apache.

I'm pretty sure that I'm close to having it working, but I just don't have things correct in httpd.conf. Can someone who has the module working tell me "top or bottom" on the AddModule statement and then provide in the exact syntax, context, and location of the "Auth_MYSQL Off" line?

Thanks. This kind of information really needs to be included in the docs, but of course it isn't. I already have an inquiry on the Sourceforge project forum, but I haven't received a response yet.
 

soundguy

Well-Known Member
PartnerNOC
Oct 29, 2003
52
0
156
seattle
So then...no one here uses this module?
 

Gavster

Active Member
Apr 3, 2002
27
0
301
soundguy said:
I've been trying (unsuccessfully) to install mod_auth_mysql on a Cpanel-Release/CentOS 4.1 box. It compiles clean and apxs seems to install correctly but any attempt to use the module in .htaccess throws the error Invalid command 'Auth_MYSQL', perhaps mis-spelled or defined by a module not included in the server configuration which leads me to believe it's not being loaded.
You appear to be using the older, depracated syntax for mod_auth_mysql directives - which version did you build?

According to the docs, the correct statement in httpd.conf is

LoadModule mysql_auth_module modules/mod_auth_mysql.so

but since that directory doesn't exist, I have been using

LoadModule mysql_auth_module libexec/mod_auth_mysql.so
modules/mod_auth_mysql.so is correct - since "modules" is mapped to /usr/local/apache/libexec when apache is compiled.

I'm also unclear on where to put the line

AddModule mod_auth_mysql.c

Logic dictates that it would go at the end of the list of XXX.c statements, but at least one article I ran a cross in the wild stated that it needed to go at the top of that group or it would break .htaccess altogether. (I tried it at the bottom and everything did indeed stop working)
I've had no problems with it at the end of the list, but if you are having problems, try it at the top of the list.

Lastly, the module is compiled to be active all the time, but I need to run more than one authorization scheme on this machine for a little while longer while I do some testing, so I need to turn it off in httpd.conf for now, but I can't figure out where (and how) to add Auth_MYSQL Off without causing an error in Apache.
I'd recommend that you re-compile mod_auth_mysql with the -DENABLE=0 flag - this will keep it off globally, and you can turn it on anywhere in .htaccess or a virtual host container with:

AuthMySQLEnable On

Alternatively, you can just turn it off globally in httpd.conf with:

AuthMySQLEnable Off

Then re-enable on a virtual host or .htaccess basis.

Thanks. This kind of information really needs to be included in the docs, but of course it isn't.
Actually, it is. See the CONFIGURE file in the source package. Latest version can be downloaded from http://sourceforge.net/projects/modauthmysql/

Kind regards,

Gavin