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

cd /home/admin/web/
mkdir /home/admin/web/; # create a folder that will be  protected
vim index.php; # test file

fill it with:

echo getcwd();

call it to see the path where to store your .htpasswd

generate it:

you should get a line like:


fill the following file with the generated line:

vim /home/admin/web/

lets go back to our protected folder

cd /home/admin/web/;
vim .htaccess; # create htaccess file

fill it with this content:

AuthType Basic
AuthName "Password Protected Area"
AuthUserFile /home/admin/web/
Require valid-user


please check your error logs:

less /var/log/apache2/domains/;

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