Thursday, January 2, 2020

Implement HTTP Basic Authentification for your website

1. Create password file and add user/pass:
sudo htpasswd -c /etc/httpd/passwd/.easybiny user

2. Add the following directive to your desired virtual host/folder:
<Directory "/var/www/html/easybiny/stage">
    AuthType Basic
        AuthName "Restricted Content"
        AuthUserFile /etc/httpd/passwd/.easybiny
        Require valid-user
</Directory>


3. Test - it shall work like a charm:


No comments:

Post a Comment