Basic authentication
To protect some directory with basic authentication we have to edit the virtual host file and add some configurations like this:
<Directory /home/someuser/somesite/public_html>
AuthType Basic
AuthName "Authentication Required"
AuthUserFile "/home/someuser/.htpasswd"
Require valid-user
</Directory>
Then we have to create the user credentials file (AuthUserFile) with htpasswd command, in this example we will be using the file "/home/someuser/.htpasswd"
Using bcrypt
htpasswd -nbB USERNAME PASSWORD
Using MD5
htpasswd -nbm USERNAME PASSWORD
Using SHA1
htpasswd -nbs USERNAME PASSWORD
Using CRYPT
htpasswd -nbd USERNAME PASSWORD
https://wiki.apache.org/httpd/PasswordBasicAuth
https://httpd.apache.org/docs/2.4/misc/password_encryptions.html