Forum Moderators: phranque

Message Too Old, No Replies

Folder Auth using .htaccess & MySQL

is this possible using a Windows server?

         

phill2000star

10:49 am on Apr 8, 2009 (gmt 0)

10+ Year Member



Hi all.

I am currently building an Intranet for work, and we need a secure section for Admin users.

At the moment I am working out the best way to Authenticate admin users. I know I have a choice of using .htaccess & .htpasswd which could work well, but I am keen to use the existing MySQL DB in conjunction with .htaccess & .htpasswd.

Ideally the user would navigate to the secure directory and be prompted for their username & password. This will be verified against the MySQL DB and the user would be authenticated, but I have no idea how to get .htaccess & .htpasswd to use the DB for the user details?!

I have checked online to see if it is possible and can find very little to assist me. I did find an Apache module that would work, however I cannot compile the module as I am running a WAMP setup and not a LAMP one.

Can anyone push me in the right direction? All help would be greatly appreciated!

Caterham

11:50 am on Apr 8, 2009 (gmt 0)

10+ Year Member



Use mod_authn_dbd [httpd.apache.org] instead of mod_authn_file [httpd.apache.org] as authentication provider, in combination with e.g. mod_authz_user [httpd.apache.org] as authorization module and mod_auth_basic [httpd.apache.org] as type.

See [httpd.apache.org...]

phill2000star

11:56 am on Apr 8, 2009 (gmt 0)

10+ Year Member



Hi Caterham.

Thanks very much for your reply!

I have looked at this and I don't have this module installed. And a search simply results in manuals on how to use this module?!

Do you know where I can get the module from, and if I will have the same issue as the last i.e. compiling the module on a WAMP setup?

Many thanks!

Caterham

2:40 pm on Apr 8, 2009 (gmt 0)

10+ Year Member



Obtain the 2.2.11 win32 binary from [httpd.apache.org...]

phill2000star

5:29 pm on Apr 8, 2009 (gmt 0)

10+ Year Member



Thanks again Caterham. I got it working after a lot of messing about.

I didn't realise you had to have the APR utils installed, and as I was on Apache v2.2.4 they weren't included!

After I removed my WAMP 1.7.9 install I upgraded to WampServer 2.0g-1 which uses Apache 2.2.11 and has the APR bundled within.

Cheers for your help ;)