.htaccess for password protection
Sample httpd.conf
<<<< snip >>>>
<VirtualHost 192.168.22.33>
ServerAdmin webmaster@techquotes.com
DocumentRoot /home/techquotes/htdocs
ScriptAlias /cgi-bin/ /home/techquotes/cgi-bin/
ServerName www.techquotes.com
ErrorLog logs/www.techquotes.com-error_log
CustomLog logs/www.techquotes.com-access_log common
<Directory /home/techquotes/htdocs>
AllowOverride AuthConfig
</Directory>
</VirtualHost>
<<<<< snip >>>>
Now the /home/techquotes/htdocs/.htaccess file
<<<< snip >>>>
AuthUserFile /home/techquotes/.htpasswd
AuthGroupFile /dev/null
AuthName EnterPassword
AuthType Basic
require user tquser
<<<< snip >>>>
After these two files are created, we need to setup the user and password for access
$/usr/local/apache2/bin/htpasswd -c /home/techquotes/.htpasswd tquser
New password:
Re-type new password:
Adding password for user tquser
$
So we are set - then i try www.techquotes.com and I am prompted for a Password !!!