Menu

Authentication problem

Help
rodnod
2005-01-05
2013-04-23
  • rodnod

    rodnod - 2005-01-05

    I have a issue with mod_auth_mysql authentication with Apache. Problem is it won't authenticate, just blocks access to the web page even if you use a valid username and password.
    I am using all the standard packages that are built into RHEL-ES v3 and have activated my registration so up2 date is functional. I've looked at RHEL FAQ's & documentation, mod_auth_mysql source forge home page to get configuration notes.  There is nothing in the log files to indicate a problem. I have set up configuration files as per instructions from source forge, and have checked installation on our RedHat 8 server to compare set up. The Apache and MySQL daemons are running and mod_auth_mysql module appears to load when apache starts.

    This is my conf file:
    #
    # Apache Security definitions protecting ARW Branch Report Directories
    #
    <Directory /var/www/html/arwintranet/>
       AuthName "ARW Intranet Auth Test"
       AuthType Basic
       AuthMySQLHost localhost
       AuthMySQLDB intranetauth
       AuthMySQLUserTable user_info
       require valid-user
       AuthMySQLUser iauth
       AuthMySQLPassword iauth
       AuthMySQLGroupTable group_info
       AuthMySQLGroupField group_name
       require group 900 1 50 ARW
    </Directory>

    According to the documentation this conf should work with apache 2...but it still denies access. If I remove the require statements it obviously allows access. 
    I have another database for staff contact details that doesn't have any authentication and works fine, which shows that the MySQL databse is running ok and Apache and php also working OK.

    I have tried to add this directive 'AuthMySQLEnable On' but it crashes the apache daemon with this error:

    [root@inferno tmp]# service httpd restart
    Stopping httpd:   OK  ]
    Starting httpd: [Tue Jan 04 16:04:41 2005] [warn] module mysql_auth_module is al
    ready loaded, skipping
    Syntax error on line 10 of /etc/httpd/conf.d/02ARWBranchRepSec.conf:
    Invalid command 'AuthMySQLEnable', perhaps mis-spelled or defined by a module no
    t included in the server configuration
    FAILED]

    As far as I can work the problem is caused by apache not receiving correct authentication from MySQL database. I have been trying for a few days to work out this problem but have come to a brick wall.

    Thanks in advance
    rod

     
    • Jerry Stuckle

      Jerry Stuckle - 2005-01-05

      Rod,

      Ok, first of all - how are your tables set up?  Since you didn't specify AuthMySQLNameField or AuthMySQLPasswordField, are your tables set up to take the defaults (user_name and user_password, respectively)?

      What does your Apache error log show?  If there is an authentication failure, you will get at least one message there.

      The module does work on Apache 2.0.  But it does need to be properly configured.

      Jerry

       
    • rodnod

      rodnod - 2005-01-05

      I modified the directory configuration to include specific name and password fields, but still won't authenticate. Apache access logs are empty.

      This is the only error message in the apache log file:

      [Wed Jan 05 13:54:29 2005] [notice] child pid 2496 exit signal Segmentation faul
      t (11)
      [Wed Jan 05 14:00:36 2005] [notice] child pid 2498 exit signal Segmentation faul
      t (11)
      [Wed Jan 05 14:01:25 2005] [notice] child pid 2502 exit signal Segmentation faul
      t (11)
      [Wed Jan 05 14:07:34 2005] [notice] caught SIGTERM, shutting down
      [Wed Jan 05 14:07:35 2005] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin
      /suexec)
      [Wed Jan 05 14:07:35 2005] [notice] Digest: generating secret for digest authent
      ication ...
      [Wed Jan 05 14:07:35 2005] [notice] Digest: done
      [Wed Jan 05 14:07:36 2005] [notice] Apache/2.0.46 (Red Hat) configured -- resumi
      ng normal operations.

      Thanks
      Rod.

       
    • Jerry Stuckle

      Jerry Stuckle - 2005-01-05

      Rod,

      The segfault is key here.  There are two possibilties I know of:

      1. You didn't stop and start Apache after recompiling the module.  You can't just reload the configuration; you must do a full stop and restart.

      2. You're using two different levels of MySQL libraries.  Although this normally causes a problem at startup (Apache won't start), I guess it could happen during operations.  This is most likely because you are using another package (i.e. the precompiled version of PHP) which is compiled against a different version of MySQL.  All packages must be compiled against the same version of MySQL.  See the CONFIGURE file for more info on this problem.

      Does this help?

      Jerry

       
      • rodnod

        rodnod - 2005-01-06

        Jerry,

        Yeah it is the segmentation fault error that is mentioned in the configuration page. But what concerns me is that all the rpms that came with the distro were compiled by presumably RedHat. Very Slack...
        Any tips on compiling, I am using MySQl-3.23.58-2.3, httpd-2.0.46-44.ent.

        Thanks
        Rod.

         
    • Jerry Stuckle

      Jerry Stuckle - 2005-01-06

      Rod,

      The rpms may or may not have been compiled by RedHat - I'm really not sure.  I do know that PHP, for instance, does come in a pre-compiled version as well as source.  Whether RedHat recompiles it, I don't know.

      Another problem is that they are usually very back-level.  For instance - the current version of MySQL is 4.1.8 and Apache is 2.0.52.

      Personally, I've gotten away as much as I can from rpms and the like.  I generally download the sources and compile them myself.  It takes a little longer - but I'm able to configure the packages as I wish, and know everything's compiled against the same version.

      As for your problem - the only thing I can recommend is trying to back out some of the modules which use MySQL until you no longer get the segfault (PHP would be a good start).  This will give you an idea as to where the conflict is.  Then follow up with the appropriate module(s) to get them recompiled with the same MySQL level.

      Jerry

       
      • rodnod

        rodnod - 2005-01-09

        Jerry,

        got it working....yeah needed to compile apache, php and modules with the MySQL libclient files i'm using. Decided to upgrade all software to latest stable versions as well. All working fine.

        Thanks for your help mate..
        Rod.

         
    • Jerry Stuckle

      Jerry Stuckle - 2005-01-10

      Rod,

      Glad to hear you got it working.  I know it's a pain, but personally I'm glad I did the compilations myself.  I hope you will be :-).

      Meanwhile - I'm still fighting some other problems with MySQL 4.1.8 and some changes I'm making in the module...

      Jerry

       

Log in to post a comment.