Results 1 to 9 of 9

Thread: mod_auth_mysql errors

  1. #1
    Join Date
    Mar 2008
    Location
    Ferndown, Dorset
    Beans
    81

    mod_auth_mysql errors

    Hi I'm new to servers and struggling to get mod_auth_mysql to work.

    I've had mysql working well for some time now, I then added a .htaccess and .htpasswd file and that worked fine.

    I've now installed mod_auth_mysql but get errors. My .htaccess looks like this at the moment:
    AuthName "some name"
    AuthType Basic

    Auth_MySQL On
    Auth_MySQL_Host local

    Auth_MySQL_DB bwam
    Auth_MySQL_Password_Table observers
    Auth_MySQL_Username_Field username
    Auth_MySQL_Password_Field password
    Auth_MySQL_Encryption_Types Plaintext
    Auth_MySQL_Empty_Passwords off

    Auth_MySQL_Authoritative on

    require valid-user


    I have also removed the .htpasswd file as I believe it is no longer required.

    In my web site each time I expect to see a login box I get a Internal Server Error page. The Apache2 error.log shows (9)Bad file descriptor: Could not open password file: (null) refer: http:// address of my server

    Can anybody give me some advice please?
    Last edited by xsilvergs; July 26th, 2009 at 02:07 PM. Reason: typos
    Ubuntu 32-bit OS

  2. #2
    wojox is offline I Ubuntu, Therefore, I Am
    Join Date
    Apr 2009
    Beans
    8,630

    Re: mod_auth_mysql errors

    Try this:

    AuthName "some name"
    AuthType Basic

    AuthMySQLEnable On
    AuthMySQLHost localhost

    AuthMySQLDB test
    AuthMySQLUserTable observers
    AuthMySQLNameField username
    AuthMySQLPasswordField password
    AuthMySQLPwEncryption none
    AuthMySQLNoPasswd Off

    AuthMySQLAuthoritative On

  3. #3
    Join Date
    Mar 2008
    Location
    Ferndown, Dorset
    Beans
    81

    Re: mod_auth_mysql errors

    Hi wojox, thanks for reply.

    I tryed your suggestion, it still doesn't work but the error.log now reads:-

    [alert] [client 192.168.1.3] /var/www/BWAMgoog/observers/.htaccess: Invalid command 'AuthMySQLEnable', perhaps misspelled or defined by a module not included in the server configuration, referer: http://192.168.1.104/BWAMgoog/index.php

    Can you help with this?

    Thanks
    Ubuntu 32-bit OS

  4. #4
    Join Date
    Mar 2008
    Location
    Ferndown, Dorset
    Beans
    81

    Re: mod_auth_mysql errors

    Well I've got a little further and my .htaccess looks like this:-

    Auth_MySQL On
    Auth_MySQL_Authoritative on
    Auth_MySQL_Host localhost

    Auth_MySQL_DB bwam
    Auth_MySQL_Password_Table observers
    Auth_MySQL_Empty_Passwords Off
    Auth_MySQL_Encrypted_Passwords on
    Auth_MySQL_Username_Field username
    Auth_MySQL_Password_Field password
    Auth_MySQL_Encryption_Types MySQL


    AuthBasicAuthoritative Off
    AuthUserFile /dev/null

    AuthName "observers sections"
    AuthType Basic

    <Limit GET POST>
    Require valid-user
    </Limit>

    Now when I hit the button in my web page I get the login box but when I type in a correct name and password followed by OK the login box reappears empty waiting for me to login.

    Here are the changes I've made to the apache2.conf:-

    Auth_MySQL_Info localhost name password

    <Directory "/var/www/BWAMgoog/observers">
    Options +Indexes FollowSymLinks MultiViews
    AllowOverride AuthConfig Options FileInfo Limit
    Order allow,deny
    Allow From All
    </Directory>

    Any ideas?
    Last edited by xsilvergs; July 27th, 2009 at 04:30 PM.
    Ubuntu 32-bit OS

  5. #5
    Join Date
    Mar 2008
    Location
    Ferndown, Dorset
    Beans
    81

    Re: mod_auth_mysql errors

    Well I keep trying but have now run out of new ideas.

    I get an error message in apache2 error.log:-

    [error] [client 192.168.1.3] user joe.bloggs not found

    Can any one help please??

    Thank you
    Ubuntu 32-bit OS

  6. #6
    wojox is offline I Ubuntu, Therefore, I Am
    Join Date
    Apr 2009
    Beans
    8,630

    Re: mod_auth_mysql errors

    What does /var/log/mysql/mysql.log say?

  7. #7
    Join Date
    Mar 2008
    Location
    Ferndown, Dorset
    Beans
    81

    Re: mod_auth_mysql errors

    /var/log/mysql is empty! The folder is empty.
    Ubuntu 32-bit OS

  8. #8
    Join Date
    Mar 2008
    Beans
    28

    Re: mod_auth_mysql errors

    I am fighting the same problem you posted. Did you ever get it solved?

    Happy New Year!
    Last edited by EdGy28376; January 1st, 2010 at 03:35 AM.

  9. #9
    Join Date
    Mar 2007
    Location
    New York City area
    Beans
    69
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: mod_auth_mysql errors

    Edit: I didn't realize he had already done the following, and it didn't fix it for him. It did fix it for me however, so I'll leave it for anyone else that comes across this thread with this error.

    ---
    I know this is an old thread, but it comes up pretty high in a Google search, so I figured I'd post the answer.

    Apache2 will still try to use the file auth as the primary authentication source. If the AuthUserFile isn't set, you get the bad file descriptor error. If it is set, then Apache only uses that. The fix is to add this:

    Code:
    AuthUserFile /dev/null          
    AuthBasicAuthoritative Off
    You may also need the following:
    Code:
    Auth_MySQL_Authoritative On
    I don't think you do, but I haven't tested without it.
    Last edited by fang0654; May 1st, 2012 at 08:34 PM. Reason: Didn't notice that this was redundant

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •