1. Create a .htaccess file and save it on the web directory that we want to protect. (e.g in /var/www/html/ )
A sample .htacess file should contain 4 settings:
AuthName "Secure Place"
AuthType Basic
AuthUserFile /etc/httpd/conf/.htpasswd
require valid-user