Configuring .htaccess for Password Authentication |
index |
| Simple Auth | Group Auth | Password Management | Group Management |
AuthUserFile /usr/local/htpasswd/.htpasswd AuthGroupFile /dev/null AuthName "Please enter password" AuthType Basic <Limit GET POST> require valid-user </Limit>
AuthUserFile /usr/local/htpasswd/.htpasswd AuthGroupFile /usr/local/htpasswd/.htgroup AuthName "Please enter password" AuthType Basic <Limit GET POST> require user joe sally bob require group admins </Limit>
cd to the directory in which the .htpasswd file
should exist
htpasswd -c .htpasswd username.
This will create the new .htpasswd file and add the first username
into it. It will then ask you for the password for that username.
htpasswd .htpasswd
username.
user:$1$VqLTB/..$w1WS3OUqXwOr42xTHR31e1 user2:$1$zf1Wo/..$SRY1LpMqYVCsndxlLD1Hz/ |
# Example .htgroup file group1:user1,user2,user3 group2:user2 |