Example we set authen basic for WebBase folder
1. cd WebBase
2. In WebBase folder make .htaccess
vim .htaccess
Add contents :
AuthUserFile /var/www/html/private/.htpasswd
AuthGroupFile /dev/null
AuthName "My Private Directory"
AuthType Basic
<Limit GET POST>
require valid-user
</Limit>
3. Make file .htpasswd with username is admin
htpasswd -c /var/www/html/private/.htpasswd admin
1. cd WebBase
2. In WebBase folder make .htaccess
vim .htaccess
Add contents :
AuthUserFile /var/www/html/private/.htpasswd
AuthGroupFile /dev/null
AuthName "My Private Directory"
AuthType Basic
<Limit GET POST>
require valid-user
</Limit>
3. Make file .htpasswd with username is admin
htpasswd -c /var/www/html/private/.htpasswd admin
Comments
Post a Comment