Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 17
  1. #1
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Oct 2003
    Location
    seattle
    Posts
    50

    Default Mod_auth_mysql

    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.
    wwww.themothership.net
    Webhosting for Musicians

  2. #2
    Member
    Join Date
    Apr 2007
    Location
    Bakersfield, California
    Posts
    270

    Default

    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.

  3. #3
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Oct 2003
    Location
    seattle
    Posts
    50

    Default

    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.
    wwww.themothership.net
    Webhosting for Musicians

  4. #4
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by soundguy View Post
    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...h_mysql.tar.gz

  5. #5
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Oct 2003
    Location
    seattle
    Posts
    50

    Default

    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?
    wwww.themothership.net
    Webhosting for Musicians

  6. #6
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by soundguy View Post
    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.

  7. #7
    Member
    Join Date
    Jun 2008
    Posts
    48

    Default

    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?

  8. #8
    cPanel Staff
    Join Date
    Mar 2004
    Posts
    704

    Default

    Quote Originally Posted by C4talyst View Post
    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?

  9. #9
    Member
    Join Date
    Jun 2004
    Posts
    57

    Default

    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

  10. #10
    Registered User
    Join Date
    Feb 2009
    Posts
    2

    Default

    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

  11. #11
    cPanel Staff
    Join Date
    Mar 2004
    Posts
    704

    Default

    Quote Originally Posted by baqpad View Post
    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
    Not sure about their site, but will the mod_auth_mysql option module help?

    CustomMods < EasyApache3 < TWiki

  12. #12
    Registered User
    Join Date
    Feb 2009
    Posts
    2

    Default

    Thanks cpdan, will try that and post result here again.

  13. #13
    cPanel Partner NOC cPanel Partner NOC Badge DWHS.net's Avatar
    Join Date
    Jul 2002
    Location
    LA, Costa RIca
    Posts
    1,356

    Default

    Quote Originally Posted by cpdan View Post
    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.

  14. #14
    Member
    Join Date
    Jun 2004
    Posts
    57

    Default

    Since nuxwin.com is down, here is the apache2.2.diff file just in case anyone still needs it.
    Attached Files

  15. #15
    cPanel Staff
    Join Date
    Mar 2004
    Posts
    704

    Default

    Quote Originally Posted by DWHS.net View Post
    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.

Similar Threads & Tags
Similar threads

  1. How to install mod_auth_mysql?
    By anton_latvia in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 04-17-2005, 08:23 AM
  2. mod_auth_mysql
    By 123 in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 03-24-2005, 09:53 AM
  3. mod_auth_mysql
    By alterahosting in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 04-14-2003, 04:21 PM
  4. Mod_Auth_Mysql
    By jrplaz in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-15-2003, 12:09 AM
  5. mod_auth_mysql
    By m0bster in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 03-20-2002, 09:23 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube