I tried installing mod_auth_mysql with Apache 2.2.13 using the EasyApache Custom Modules but I ran into this problem:
'/usr/local/apache/bin/apxs -i -a -c -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.c' failed with exit code '256'
More details from the log below:
Code:
-- Begin opt 'Mod Auth MySQL (Custom Opt Mod)' --
-- Begin step 'Compiling, installing, and activating' --
/usr/local/apache/build/libtool --silent --mode=compile gcc -prefer-pic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/local/apache/include -I/usr/local/apache/include -I/usr/local/apache/include -c -o mod_auth_mysql.lo mod_auth_mysql.c && touch mod_auth_mysql.slo
mod_auth_mysql.c:269:19: mysql.h: No such file or directory
mod_auth_mysql.c:379: error: syntax error before "MYSQL"
mod_auth_mysql.c:379: warning: no semicolon at end of struct or union
mod_auth_mysql.c:384: error: syntax error before '}' token
mod_auth_mysql.c:384: warning: data definition has no type or storage class
mod_auth_mysql.c:386: error: syntax error before "connection"
.
.
.
mod_auth_mysql.c:1136: error: request for member `handle' in something not a structure or union
mod_auth_mysql.c:1142: error: `MYSQL_ROW' undeclared (first use in this function)
mod_auth_mysql.c:1142: error: syntax error before "data"
mod_auth_mysql.c:1143: error: `data' undeclared (first use in this function)
apxs:Error: Command failed with rc=65536
!! apxs failed, Retrying with additional arguments that may help !!
/usr/local/apache/build/libtool --silent --mode=compile gcc -prefer-pic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/local/apache/include -I/usr/local/apache/include -I/usr/local/apache/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')
.
.
.
mod_auth_mysql.c:671: error: initializer element is not constant
mod_auth_mysql.c:671: error: (near initialization for `mysql_auth_cmds[19]')
mod_auth_mysql.c:675: error: initializer element is not constant
mod_auth_mysql.c:675: error: (near initialization for `mysql_auth_cmds[20]')
mod_auth_mysql.c: In function `format_request':
mod_auth_mysql.c:947: warning: pointer/integer type mismatch in conditional expression
apxs:Error: Command failed with rc=65536
.
!! '/usr/local/apache/bin/apxs -i -a -c -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.c' failed with exit code '256' !!
!! Restoring original working apache !!
Just in case this helps someone, I did get it working manually. Here is what I did:
Get the latest mod_auth_mysql from sourceforge
Code:
wget http://downloads.sourceforge.net/project/modauthmysql/modauthmysql/3.0.0/mod_auth_mysql-3.0.0.tar.gz
Decompress the file
Code:
tar xvzf mod_auth_mysql-3.0.0.tar.gz
Change Directory
Code:
cd mod_auth_mysql-3.0.0
Get the patch for Apache 2.2
Code:
wget http://download.nuxwin.com/apache2.2-modules/auth_mysql/patch/apache2.2.diff
Patch the source file
Code:
patch -p0 < apache2.2.diff mod_auth_mysql.c
Build and install
Code:
/usr/local/apache/bin/apxs -i -a -c -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.c
For me the httpd.conf file was updated automatically. The following line was added.
Code:
LoadModule mysql_auth_module modules/mod_auth_mysql.so
Ran this just to make sure the changes stick in the httpd.conf file
Code:
/usr/local/cpanel/bin/apache_conf_distiller --update