Thursday, August 19, 2010

Steps to protect a simple Apache Web Server using user-based authentication

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