Mam Apache 2.0.46 (pod Windowsem 98SE).
Chciałbym ustawić dostęp do danego folderu na hasło (autoryzacja). Wygenerowałem z linii komend plik .htpasswd (za pomocą programu wbudowanego w Apache). I moje pytanie: jakiego szyfrowania muszę użyć? MD5 czy CRYPT?
Bo coś mi nie działa... Fakt wyskakuje okienko z prośbą o podanie nazwy użytkownika i hasła, ale jak wpisuję hasło i dam OK, to okienko znów się pojawia (i tak w kółko do momentu gdy dam Anuluj).
W pliku httpd.conf ustawiłem AllowOverride All dla plików .htacces, tak więc tutaj jest ok...
Mój plik .htaccess
Kod
AuthType Basic
AuthName "PODAJ HASLO ADMINA"
AuthUserFile .htpasswd
require valid-user
AuthName "PODAJ HASLO ADMINA"
AuthUserFile .htpasswd
require valid-user
Mój plik .htpasswd (za każdym razem gdy go generuję kod wygląda inaczej...(?))
Kod
ADMIN:$apr1$SL0.....$5z5QVLYytNhgApl97jLS00
Może chodzi o kodowanie hasła?? Dla htpasswd.exe mam takie info:
Cytat
Usage:
htpasswd [-cmdpsD] passwordfile username
htpasswd -b[cmdpsD] passwordfile username password
htpasswd -n[mdps] username
htpasswd -nb[mdps] username password
-c Create a new file.
-n Don't update file; display results on stdout.
-m Force MD5 encryption of the password (default).
-d Force CRYPT encryption of the password.
-p Do not encrypt the password (plaintext).
-s Force SHA encryption of the password.
-b Use the password from the command line rather than prompting for
-D Delete the specified user.
On Windows, NetWare and TPF systems the '-m' flag is used by default.
On all other systems, the '-p' flag will probably not work.
htpasswd [-cmdpsD] passwordfile username
htpasswd -b[cmdpsD] passwordfile username password
htpasswd -n[mdps] username
htpasswd -nb[mdps] username password
-c Create a new file.
-n Don't update file; display results on stdout.
-m Force MD5 encryption of the password (default).
-d Force CRYPT encryption of the password.
-p Do not encrypt the password (plaintext).
-s Force SHA encryption of the password.
-b Use the password from the command line rather than prompting for
-D Delete the specified user.
On Windows, NetWare and TPF systems the '-m' flag is used by default.
On all other systems, the '-p' flag will probably not work.
Pozdrawiam.
P.S. Pliki .htaccess i .htpasswd mam umieszczone razem w folderze "admin", próbuję się do niego dostać z http://127.0.0.1/admin/ i wtedy wyskakuje okienko z monitem o podanie nazwy użytkownika i hasła. Gdy wpiszę oba i wcisnę OK, okienko znów się pojawia i tak na okrągło do momentu gdy się wkurzę
