.htaccess also known as hypertext access! It provides a way to configure access on a per directory basis.
Lets say you want to password your whole site. (I am assuming that you left your site in /var/www – If not you will have to change accordingly)
sudo vi /var/www/.htaccess
AuthName “Authorization Required”
sudo htpasswd -c /home/YOURUSER/.htpasswd YOURUSER
use the password you want here
sudo /etc/init.d/apache2 restart
Now only the person with username & password you selected will be able to get in!
Open your browser and browse to the website!
If everything goes well you will go straight to it!
If not you will end up with something like this :[
- Some issues I have noticed with people using .htaccess files is when they do not have the correct permissions or not owned by the correct user