1.
Is .htaccess enabled?
In virtual host configuration:
AllowOverride None
change it to
AllowOverride All
2.
restart apache /etc/init.d/apache2 restart
3.
In to folder you want to protect, make file with name .htaccess
Sample .htaccess file for password protection:
AuthType Basic
AuthName "restricted area"
AuthUserFile /usr/local/var/www/html/.htpasses
require valid-user
4.
create pass file /usr/local/var/www/html/.htpasses
5.
make new pass
htpasswd -c /usr/local/var/www/html/.htpasses jimmy
Leave a Reply