Mod_auth_mysql loaded but not working

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Mod_auth_mysql loaded but not working

Postby JesseS » 19. September 2006 16:41

Hello,

I've loaded mod_auth_mysql in the httpd.conf file and it shows up as loaded in phpinfo()

LoadModule mysql_auth_module modules/mod_auth_mysql.so


This is my .htaccess file. I already created a database called 'webauth' with table 'user_pwd' containing corresponding name/pass fields.

AuthName "Realm Name"
AuthType Basic
require valid-user

Auth_MYSQL On
Auth_MYSQL_DB webauth
Auth_MYSQL_Username root
Auth_MYSQL_Password rootpassword
Auth_MYSQL_Password_Table user_pwd
Auth_MYSQL_Username_Field name
Auth_MYSQL_Password_Field pass
Auth_MYSQL_Empty_Passwords On
Auth_MYSQL_Encryption_Types Plaintext



When I try to access http://localhost/mysql/content.html, I get a server error, along with this in the error.log

[Tue Sep 19 08:49:29 2006] [alert] [client 127.0.0.1] C:/Program Files/xampp/htdocs/mysql/.htaccess: Invalid command 'Auth_MYSQL', perhaps misspelled or defined by a module not included in the server configuration


I tried changing Auth_MYSQL (which I believe is correct) to Auth_MySQL, but I get the same error.

Any ideas? Thanks in advance.
JesseS
 
Posts: 3
Joined: 14. September 2006 17:12

Postby Wiedmann » 19. September 2006 18:25

The configure options for mod_auth_mysql are:
AuthMySQLEnable On
AuthMySQLHost localhost
AuthMySQLPort <default port in MySQL>
AuthMySQLSocket <default socket in MySQL>
AuthMySQLUser <no default -- NULL>
AuthMySQLPassword <no default -- NULL>
AuthMySQLDB test
AuthMySQLUserTable user_info
AuthMySQLUserCondition <no default>
AuthMySQLNameField user_name
AuthMySQLPasswordField user_passwd
AuthMySQLNoPasswd Off
AuthMySQLPwEncryption md5
AuthMySQLSaltField <>
AuthMySQLGroupTable <defaults to value of AuthMySQLUserTable>
AuthMySQLGroupCondition <no default>
AuthMySQLGroupField <no default>
AuthMySQLKeepAlive Off
AuthMySQLAuthoritative On


In the file "\xampp\apache\conf\extra\httpd-xampp.conf" you can find a sample usage of this module.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby teres » 05. January 2007 04:36

Dear all,

I've the same problem: mod_auth_mysql loaded (by uncomment LoadModule mysql_auth_module modules/mod_auth_mysql.so in httpd.conf, do I need uncomment any other lines?) but not worked. I use XAMPP 1.53a.

I've tried both as .htacess and httpd.conf. It ask me user name and password but couldn't got autheticated to load the page. Acutally I first tried md5 encryption (Of course I've add record to the database already with md5(password) encrypted.) and then use none Both can't work. Here is the entry added in httpd.conf with reference to the xampp\apache\conf\extra\httpd-xampp.conf.

---
<IfModule mysql_auth_module>
<Location /liberate/test/security/>
AuthMySQLEnable On
AuthName "MySQL Secured Place"
AuthType Basic
require valid-user
AuthMySQLHost localhost
AuthMySQLUser user
# AuthMySQLPassword
AuthMySQLDB test
AuthMySQLUserTable user_info
AuthMySQLNameField user_name
AuthMySQLPasswordField user_passwd
AuthMySQLPwEncryption none
</Location>
</IfModule>
---

Please help as I've spent two day on this already .... got frustrated.

Best regards,
Teres
teres
 
Posts: 6
Joined: 04. January 2007 09:43

Postby teres » 05. January 2007 07:56

Dear all,

I've figured it out. I confused with the user name and password with select right and those user name and password in the authentication table.

However, I've another question when I switch to the md5 encryption. I can run AuthType Digest with file authetication in .htaccess:
---
AuthType Digest
AuthName "md5"
AuthDigestDomain /liberate/test/md5
BrowserMatch "MSIE" AuthDigestEnableQueryStringHack=On
AuthDigestProvider file
AuthUserFile "C:/Program Files/xampp/security/md5pass"
Require valid-user
---

However, I can't run with mod_auth_mysql:
---
AuthMySQLEnable On
AuthName "MySQL Secured Place"
AuthType Basic
require valid-user
AuthMySQLHost localhost
AuthMySQLUser user
AuthMySQLPassword password
AuthMySQLDB test
AuthMySQLUserTable user_info
AuthMySQLNameField user_name
AuthMySQLPasswordField user_passwd
AuthMySQLPwEncryption md5
----

I tried to change AuthType Digest and still can't authenticate. I did use md5() to encrypt a sample user's password already.

What else should I do?!

Best regards,
Teres
teres
 
Posts: 6
Joined: 04. January 2007 09:43


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 135 guests