We have an website on an hosting server which supports PHP/Apache (most web hostings support these)

How to protect some directory by password?

Create .htaccess file in the directory you want to protect:

Code:
AuthType Basic
AuthName "restricted area"
AuthUserFile /home/yourusername/public_html/admin-panel/.htpasswd
require valid-user
Then create .htpasswd file using an online htpasswd generator like http://tools.dynamicdrive.com/password/

example .htpasswd content:
Code:
admin:Sdn.Tbi5RlzSR
and make it available at path which you set in .htaccess file (AuthUserFile), you need to enter absolute path to file!