it should work.
apache2 is processing the request.
nginx and lighttpd do not support .htaccess files, you will have to change their corresponding config files.
1. ssh into your server
2. go into your domain’s public_html directory
mkdir /home/admin/web/domain-name.com/public_html/protected; # create a folder that will be protected
vim index.php; # test file
fill it with:
call it to see the path where to store your .htpasswd
generate it: http://www.htaccesstools.com/htpasswd-generator/
you should get a line like:
fill the following file with the generated line:
lets go back to our protected folder
vim .htaccess; # create htaccess file
fill it with this content:
AuthName "Password Protected Area"
please check your error logs:
hit shift+f to go into “follow mode” = screen updates whenever an error comes in.
to see if ti works… if not check your error log