9/15/2006
Compile Errors with Mod_auth_mysql and Apache 2.2
Building a new server today I had a problem compiling mod_auth_mysql 3.0 on Apache 2.2.3.
[admin@atlas mod_auth_mysql-3.0.0]# apxs -c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.c
/www/build/libtool --silent --mode=compile gcc -prefer-pic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -pthread -I/www/include -I/www/include -I/www/include -I/usr/include/mysql -c -o mod_auth_mysql.lo mod_auth_mysql.c && touch mod_auth_mysql.slo
mod_auth_mysql.c:591: error: syntax error before "mysql_auth_config_rec"
mod_auth_mysql.c:591: error: initializer element is not constant
mod_auth_mysql.c:591: error: (near initialization for `mysql_auth_cmds[0].cmd_data')
... snip ...
/www/build/libtool --silent --mode=compile gcc -prefer-pic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -pthread -I/www/include -I/www/include -I/www/include -I/usr/include/mysql -c -o mod_auth_mysql.lo mod_auth_mysql.c && touch mod_auth_mysql.slo
mod_auth_mysql.c:591: error: syntax error before "mysql_auth_config_rec"
mod_auth_mysql.c:591: error: initializer element is not constant
mod_auth_mysql.c:591: error: (near initialization for `mysql_auth_cmds[0].cmd_data')
... snip ...
Error not very desciptive. Nothing appears missing included or linked. Google turns up almost nothing. Finally, a similar error on Google. I couldn't get the patch to work, but with a little manual patching was able to get it to compile through apxs.
My patch here: mod_auth_mysql-httpd-2.2.patch
Popularity: 20%



October 22nd, 2006 at 7:19 pm
Howdy - I was wondering if you were using mod_auth_myql successfully with Apache 2.2.3. I was in a similar bind compiling-wise, and it now compiles nicely, but I’m getting no love from apache at all. The only error that shows up anywhere is “(9)Bad file descriptor: Could not open password file: (null)” I’m using the same config for the directory as one that is working on the same host under Apache 1.3. Did you have to do any additional tweaking?
Thanks for the post, I don’t feel quite so dumb now in that it appears there are others who hit the same wall.
November 10th, 2006 at 3:27 am
Thanks to author! This is a big problem that i couldnt resolve myself. Its really work! My system is - FreeBSD 6.0, Apache 2.2.3, mod_auth_mysql 3.0.0.
December 9th, 2006 at 7:38 am
Kev, You must have the:
AuthBasicAuthoritative Off
directive in the section where you use the AuthType foo, if you don’t Apache’s internals are still looking for a password file which you obviously wont have cos you want to use mysql
January 3rd, 2008 at 4:09 pm
Thanks for the patch, much appreciated.