MySQL and .htaccess together
Posted by: chrescht (---.dyn.luxdsl.pt.lu)
Date: September 01, 2009 04:42AM

Hello everybody,

I have the following problem: I would like to protect a directory using .htaccess, but the different usernames and passwords will not come from an .htpasswd but from a MySQL database. And I don't know why but it doesn't work very good because I always get a 500 error grinning smiley

My .htaccess looks like that:

AuthType Basic
AuthName "Member"
Auth_MYSQLhost localhost
Auth_MYSQLusername user
Auth_MYSQLpassword test
Auth_MYSQLdatabase test
Auth_MYSQLpwd_table member
Auth_MYSQLuid_field login
Auth_MYSQLpwd_field password
Auth_MYSQL_EncryptedPasswords off
require valid-user

For the MySQL side, there is no problem, I tried to connect and it worked fine. Using a .htpasswd file also worked good after I enabled the mod_rewrite thing. Is there maybe a problem with another module not being enabled or what I am doing wrong?

Thank you in advance,

Christian

Options: ReplyQuote
Re: MySQL and .htaccess together
Posted by: toumimi (---.54.140-88.rev.gaoland.net)
Date: September 01, 2009 02:42PM

See here for more informations : [www.widexl.com]
You need to enable mod_auth_mysql but I didn't see it into my apache modules submenu.
I hope you will have more luck winking smiley

EDIT: I found a project on SourceForge : [sourceforge.net]

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com



Edited 1 time(s). Last edit at 09/01/2009 03:05PM by toumimi.

Options: ReplyQuote
Re: MySQL and .htaccess together
Posted by: chrescht (---.dyn.luxdsl.pt.lu)
Date: September 01, 2009 04:51PM

Hello Florian,

Thank you for your answer, but isn't there an executable version for the installation of that module? I use Windows Vista and unfortunately do not understand anything about building the files there in the package confused smiley

I saw some modules in the menu, called authn_dbm and likely. I enabled them all but it still doesn't function.

Thanks,

Christian

Options: ReplyQuote
Re: MySQL and .htaccess together
Posted by: toumimi (---.54.140-88.rev.gaoland.net)
Date: September 02, 2009 03:15PM

No, you need this particular module...
I didn't see it was the source files.
Unfortunately, you will need to compile it yourself, since i only found an old compiled release of this project, and I don't know how to do to build it as a dll file..

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Options: ReplyQuote


Sorry, only registered users may post in this forum.