Password protecting with htaccess and mysql



Hey there,
I want to password a protect a directory, but have access be granted to a particular group of phpbb users. I am having a hard time trying to get the following to work. I get a 500 internal error, so know it is probably my syntax. Appreciate any help.

AuthName "directory to protect"
AuthType Basic

Auth_MySQL_Username username
Auth_MySQL_Password password
Auth_MySQL_DB database
Auth_MySQL_Password_Table phpbb_users
Auth_MySQL_Username_Field username
Auth_MySQL_Password_Field user_password
Auth_MySQL_Encrypted_Passwords On
require valid-user

Auth_MySQL_Group_Table phpbb_user_group
Auth_MySQL_Group_Field group_id
require group 65


Are you trying to run this on a DreamHost server?

mod_auth_mysql is not installed in the Apache1 or Apache2 configurations on Dreamhost. :frowning:



Yep trying to run on dh dedicated server.

Thanks for the link. I will check it out. I apparently didn’t put the right search words in when looking through the forums. :slight_smile:

Any other suggestion for using the username/password from phpbb to manage a password protected directory?




No problem, Deb. I’m not what I would have even typed into search to find that link (I wouldn’t have found it, or thought it was related to your question, had I not written it! :wink: ).

Not at the moment (though I’ll think on it a bit). Do you have the ability to add modules to Apache on your dedicated server? If so, you could add the module and try using it.

(bad “knee jerk idea” deleted - doh! :frowning: )

Actually, now that I am thinking about it, I believe the user password in phpBB is stored MD5 hashed, so if you do install the module and continue this approach, make sure you account for that with Auth_MySQL_Encryption_Types and Auth_MySQL_Encrypted_Passwords ON.

In other words, I don’t have a clue how to do this - though after googling a bit it looks like it could be accomplished. :wink:

Just a heads up if you intend o doing any PHP manipulation of Apache authentication - you will need to be running mod_php also, not PHP-CGI, for that that to work. I’d love to here back what you figure out. :slight_smile:

(edited after a little googling)