Monday 25 February 2019

Password protect to directory on the web server and Add a new user

Allow User to access the app 1. Create/Update `.htaccess` file in root directory:
    touch .htaccess
    vi .htaccess
Then, add following content:
    AuthUserFile /home/bitnami/htdocs/.htpasswd
    AuthGroupFile /dev/null
    AuthName "Application Authentication"
    AuthType Basic
    require user demo-user1
    require user test-user2
3. And, for passwords, create `.htpasswd` file in root directory.
    touch .htpasswd.
4. To add/edit password, run the following command:
    htpasswd -c .htpasswd demo-user1
    
And, follow instruction ahead.

No comments:

Post a Comment

Please post any queries and comments here.