LINUX How to configure authen basic for folder

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

Comments

Popular posts from this blog

LINUX Move and copy files using SSH

PHP Predefined Variables

Java : Variables Declaring