Apache password protect through htpasswd htaccess

Web

.htaccess

1
2
3
4
5
AuthUserFile /usr/local/username/safedirectory/.htpasswd
AuthGroupFile /dev/null
AuthName "Please Enter Password"
AuthType Basic
Require valid-user

.htpasswd

1
username:$apr1$wI1/T0nB$jEKuTJHkTOOWkopnXqC1d1

Reference

https://www.digitalocean.com/community/tutorials/how-to-use-the-htaccess-file