soundguy

Well-Known Member
PartnerNOC
Oct 29, 2003
52
0
156
seattle
Has anyone else had a problem with the new httpd.conf format created by easyapache3 with regards to running mod_auth_mysql?

In the olden days, It was a simple installation with

LoadModule mysql_auth_module libexec/mod_auth_mysql.so

located at the end of the LoadModule list and then

AddModule mod_auth_mysql.c

Placed at the very top of the AddModule list, directly under ClearModuleList. These locations are critical if you want to use mod_auth_mysql but still retain the use of other authentication methods. If mod_auth_mysql is loaded last, it will kill all other forms of authentication.

Unfortunately, with the new insanely disorganized and confusing httpd.conf format, I haven't got the slightest idea what's going on anymore and ClearModuleList is no longer used, so I can't correctly order the modules to make things work like they did in the past. The vast majority of the include files that are allegedly used to dynamically construct the working httpd.conf don't actually exist or are completely empty, so I don't have any reference points to work with.

So my question is this: Is it possible to somehow control the loading order of Apache add-on modules with the new httpd.conf format? I really need to have standard .htpasswds style Basic auth as well as mysql auth working together on the same machine and the only way to accomplish that is to load mod_auth_mysql first.
 

Voltar

Well-Known Member
Apr 30, 2007
267
0
168
Bakersfield, California
You could try adding LoadModule to /usr/local/apache/conf/includes/pre_main_global.conf

I'm not sure where you could put AddModule, I haven't used the new EasyApache setup with Apache 1.3.x.
 

soundguy

Well-Known Member
PartnerNOC
Oct 29, 2003
52
0
156
seattle
Well, it was a nice thought, but that file apparently still loads AFTER everything else. I need a way to load mod_auth_mysql before mod_auth and mod_auth_passthrough, which I guess are built-ins. They really screwed me when they took out ClearModuleList and the AddModule section.

What I REALLY need is for cPanel to include mod_auth_mysql as an optional module in EasyApache as it should have been years ago. They include all kinds of experimental and completely useless crap that no one in their right mind would ever install on a production machine and yet they omit arguably the most useful and powerful authentication module available. Makes no sense to me.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
Well, it was a nice thought, but that file apparently still loads AFTER everything else. I need a way to load mod_auth_mysql before mod_auth and mod_auth_passthrough, which I guess are built-ins. They really screwed me when they took out ClearModuleList and the AddModule section.

What I REALLY need is for cPanel to include mod_auth_mysql as an optional module in EasyApache as it should have been years ago. They include all kinds of experimental and completely useless crap that no one in their right mind would ever install on a production machine and yet they omit arguably the most useful and powerful authentication module available. Makes no sense to me.
Please investigate:

http://easyapache.cpanel.net/custom.pl
http://easyapache.cpanel.net/optmods/custom_opt_mod-mod_auth_mysql.tar.gz
 

soundguy

Well-Known Member
PartnerNOC
Oct 29, 2003
52
0
156
seattle
Well, this would be an awesome development, except for the fact that the target directory these custom mods are supposed to live in (/var/cpanel/easy/apache/custom_opt_mod) does not exist. In fact /var/cpanel does not exist.(Centos 5.1) Are we supposed to manually create this entire directory nest as part of the installation or are my servers missing some key component that needs to be installed before EasyApache can use custom mods?
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
Well, this would be an awesome development, except for the fact that the target directory these custom mods are supposed to live in (/var/cpanel/easy/apache/custom_opt_mod) does not exist. In fact /var/cpanel does not exist.(Centos 5.1) Are we supposed to manually create this entire directory nest as part of the installation or are my servers missing some key component that needs to be installed before EasyApache can use custom mods?
If the /var/cpanel directory does not exist then something is very wrong with your installation. I recommend opening a support ticket regarding this.
 

C4talyst

Well-Known Member
Jun 21, 2008
55
0
56
I downloaded this, the README in it references a file called INSTALL that is not included with it.

Anyone ever get mod_auth_mysql working?
 

cPDan

cPanel Staff
Staff member
Mar 9, 2004
724
15
243
I downloaded this, the README in it references a file called INSTALL that is not included with it.

Anyone ever get mod_auth_mysql working?
yes, I've got it working from the cutom option module, there is no README file in the option module so maybe you've got the wrong file?
 

aeroweb

Well-Known Member
Jun 4, 2004
74
2
158
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
 

baqpad

Registered
Feb 14, 2009
2
0
51
Hi all,

I've been waitings days now for nuxwin.com but their site seems to be down. Anyone could advise me where else I can get that patch? Haven't found it anywhere else.

Any help is very very welcome. Thanks
 

WebHostPro

Well-Known Member
PartnerNOC
Jul 28, 2002
1,725
28
328
LA, Costa RIca
cPanel Access Level
Root Administrator
Twitter
Not sure about their site, but will the mod_auth_mysql option module help?

CustomMods < EasyApache3 < TWiki
Do we have a time frame when this will be included in easyapache? Custom modules are too risky to use with cpanel for me. If it's not supported we will not use it but we have been getting more and more requests for this from our customers.
 

cPDan

cPanel Staff
Staff member
Mar 9, 2004
724
15
243
Do we have a time frame when this will be included in easyapache? Custom modules are too risky to use with cpanel for me. If it's not supported we will not use it but we have been getting more and more requests for this from our customers.
We currently have no plans to include any of the sample custom option modules in easyapache.
 

DomineauX

Well-Known Member
PartnerNOC
Apr 12, 2003
429
11
168
Houston, TX
cPanel Access Level
Root Administrator
Old thread I realize but mod_auth_mysql would indeed be a worthwhile addition to easyapache. The module has been around forever and is very useful and requested. If there are still no plans to ever include it fully, I think it would be helpful to know a reason for that stance.