Forum Moderators: phranque
.htaccess looks like this
(where /auth/ is the folder to be secured):
AuthType Basic
AuthName 'Restricted Area'
AuthUserFile '/auth/.htpasswd'
require valid-user
i read that .htpasswd has to be in the directory that shall be secured,
so i put it in the /auth/ folder.
now i have two problems:
1st: no matter where my .htpasswd file is, the entire domain
is secured. what can i do to just secure the auth folder?
2nd: the password is incorrect.
username is "Aladdin", password is "open sesame"
so base64 encoded "Aladdin:open sesame" would be
"QWxhZGRpbjpvcGVuIHNlc2FtZQ==".
i tried
Aladdin:QWxhZGRpbjpvcGVuIHNlc2FtZQ==but it doen's work.
QWxhZGRpbjpvcGVuIHNlc2FtZQ==doesn't work either.
what did i do wrong here?
AuthType Basic
AuthName RestrictedArea
AuthUserFile .htpasswd
Require valid-user
As of the encoding of .htpasswd, it depends on the operating system and the web server you are using, but most Apache providers can take Unix cyrpt and md5 digest form, i.e. the base64 is *not* correct. For example, the same password with crypt will be...
Aladdin:azIy8ykyDKDrY
Note that Unix crypt only makes sense for password length less than 8 characters, and md5 digest password might not be supported on all systems.
i also tried to test authentication at home (Apache/2.0.39 (Win32)),
the necessary modules loaded, neither basic nor md5 works:
http*//localhost/auth/ returns a 403 in both cases without asking for a pw
(no authentication request in the http header), and
http*//localhost/auth/test.htm gives me test.htm, also without asking for a pw
Sorry mate, can't help. But I think it does not even get into mod_auth yet because of the permission problem.