#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Canada
    Posts
    16
    Rep Power
    0
    Hi,when I excluded the directive Auth_MySQL_Info in .htaccess file, it said "access denied :no passwd provided", but then I included this directive, it said "Auth_MSQL_Info not allowed here" (in the error log file of conf)", please help! or are there any other directive that i can use in order to send the login info to mysql?
    Thanks
  2. #2
  3. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    I assumed you already created necessary info -> http://bourbon.netvision.net.il/mysql/mod_auth_mysql/ "Creating the necessary SQL information".

    Show us your .htaccess file and the appropriate section of your mod_auth_mysql of your httpd.conf

    Keep in mind, at http://bourbon.netvision.net.il/mysql/mod_auth_mysql/ , there is a line ->
    AuthName My Company's Financial Information
    the realm name, use some informative name

    This is wrong. If your company is not a single word, it has to be quoted:
    AuthName "My Company"
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Canada
    Posts
    16
    Rep Power
    0
    My .htaccess file contains:
    Auth_MySQL_DB membership
    Auth_MySQL_Password_Table

    Auth_MuSQl_Password_Field password
    AuthName "Membership"
    AuthType Basic
    require romanka

    *note: i didn't includen Auth_MySQL_Username_Field since the username field is "username",

    the appropriate section in httpd.conf:
    <Directory "/usr/local/apache/htdocs/test">
    Options All
    AllowOverride All
    </Directory>

    *note: test is the directory that I want to protect.
    Thanks for your help!
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Canada
    Posts
    16
    Rep Power
    0
    The abouve situation would result :
    MySQL auth: connect failed: Access denied for user: 'username@localhost' <Using password: No>
    That's from the error log file
  8. #5
  9. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    You need to read http://bourbon.netvision.net.il/mysql/mod_auth_mysql/ again. Way too many mistakes here. You also definitely need to figure out the standard htaccess/htpasswd combo before trying to db authentication. Also, you should use all the default table and db names.

    ##My .htaccess file contains:
    make sure such .htaccess is in /usr/local/apache/htdocs/test

    ##Auth_MySQL_DB membership
    okay. But you should use a general db to begin with to ensure apache understands "Auth_MySQL_General_DB"

    ##Auth_MySQL_Password_Table
    I assume it's "mysql_auth", it's default.

    ##Auth_MuSQl_Password_Field password
    Hey, ya mispelled MySQL!!
    Such line should be:
    Auth_MySQL_Password_Field password

    ##AuthName "Membership"
    This should be:
    AuthName Membership
    As I mentioned, if it's "Membership Only", then do this:
    AuthName "Membership Only"

    ##AuthType Basic
    okay

    ##require romanka
    This should be:
    require user romanka
    You should set it to "require valid-user" to begin with.

    In addition, you should specify the following:
    Auth_MySQL_Empty_Passwords off
    Auth_MySQL_Encryption_Types Crypt_DES

    To summaries things up:

    AuthName Membership
    AuthType Basic
    require valid-user
    Auth_MySQL_Password_Table
    Auth_MySQL_Password_Field password
    Auth_MySQL_Empty_Passwords off
    Auth_MySQL_Encryption_Types Crypt_DES

    As for your httpd.conf, specify this line at the bottom:

    Just this:
    Auth_MySQL_General_DB membership

    Not this:
    <IfModule mod_auth_mysql.c>
    Auth_MySQL_General_DB membership
    </IfModule>

    For MySQL:
    prompt> mysqladmin create membership
    prompt> mysql membership
    mysql> create table mysql_auth (
    -> username char(25),
    -> password char(25),
    -> primary key (username)
    -> );

    Be warned, you need to create a "httpd" user in the first place. Read "Telling apache to protect the page using that information" from the URL.


    [This message has been edited by freebsd (edited August 21, 2000).]
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Canada
    Posts
    16
    Rep Power
    0
    Thanks.....now I can use mod_auth_mysql...
    but....there comes another problem....whenver i type the correct user name and passwd, it prompted "Authorization failed. Try again?", the username and passwd i typed waere exactly the same as those in the mysql....i was wondering do i have to recompile apache?
  12. #7
  13. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>whenver i type the correct user name and passwd, it prompted "Authorization failed.

    That means, IT WORKED!! At least you can now use mod_auth_mysql and it's responding. As I reminded you dozen times, don't challenge Calculus if you don't know Algebra well enough.

    How do you encrypt your password??
    Show me the code how you encrypt it. I believe it's what the current problem is. But I might guess wrong.

    >>whenver i type the correct user name and passwd
    Keep in mind,
    "Auth_MySQL_Password_Field password", the default is "passwd", but you chose "password" instead, so make sure the password field name is "password", not "passwd".

IMN logo majestic logo threadwatch logo seochat tools logo