[PHP/MySQL] mod_auth_mysql with htaccess

Experienced Elementalist
Joined
Feb 19, 2003
Messages
243
Reaction score
0
Hi, I'm trying to use mod_auth_mysql to authenticate users when entering a protected area, I followed the instructions here and here and have added a user and password combo into the database using PHP.

However, the user credentials seem not to work as I can't log into the protected area using them.

Does anyone know how to do this?
 
Re: sage

Listen, you'd be far better to recreate it in php only and use sessions. It can do much the same thing.
 
Listen, you'd be far better to recreate it in php only and use sessions. It can do much the same thing.
That's not an option since it's going to used as user validation for SVN and Trac.

Need moar info.
I am trying to make it so that user info (username and password) are stored in a MySQL database and then I use mod_auth_mysql, along with htaccess, to authenticate a user using against the credentials in the database.

The passwords are stored using crypt() and are salted with themselves.

So far, I either get a "500 Internal Error" or get a login box, but am unable to log on with the username and password I set.

This is what I'm currently trying to use to authenticate a user:
Code:
AuthName "Dev"
AuthType Baisc
AuthMySQLUser (db user name)
AuthMySQLPassword (db password)
AuthMySQLDB (users db)
AuthMySQLUserTable zz_users
AuthMySQLEnable on
require valid-user
 
Last edited:
Hmm.. As for your Internal Error, it might be cause the use of wrong script in .htaccess or your web hoster doesn't allow .htaccess there might be other reasons. Anyway, good luck.
 
>AuthType Baisc
>Baisc


...
I had to type it out again to post it. That typo isn't in the actual file.


As for the htaccess comment, this is actually in the trac.conf file which gets loaded into the httpd.conf file, so strictly speaking it's not htaccess, I just dont know what else to call it.
 
Such as?

Here's the configuration guide for mod_auth_mysql, I don't know what else to say since I've said what I've done and as far as I can make out from that guide, what I've done is right, yet still it doesn't work.
 
Back