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:

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:
and make it available at path which you set in .htaccess file (AuthUserFile), you need to enter absolute path to file!