Apache .htpasswd File
.htpasswd file
- The .htpasswd file is used to store usernames and password for authentication on an Apache HTTP server.
- It is also a simple text file.
- The 'username' is in plaintext form and 'password' is stored in an encrypted form.
- The 'username' is case sensitive. 'Amit' and 'amit' are two different usernames.
Creating .htpasswd file
If you create a new .htpasswd file in D: \dwnlds\SampleDir with username Amit.
Use following command
htpasswd -c D: \dwnlds\SampleDir\ .htpasswd Amit
Where,
'-c' is used when creating a new .htpasswd file.
Configuring httpd.conf to allow authentication via .htaccess