When projects are in development stage or we may have some internal projects related to intra center and we do not intend to share/allow access to outside users, then how can we prevent this? This basic HTTP authentification can be done using .htaccess
step1: Decide the paths which you want to protect
- Path: /var/www/html/,
Path to .htaccess : /var/www/html/.htaccess,
Path to password file : /var/www/my_password_file,
step2: Create a .htaccessfile
AuthType Basic
AuthName “Authentification required”
AuthUserFile /var/www/my_password_file
Require user admin_user
step3: create a password file
htpasswd -cb /var/www/html/my_password_file admin_user password
Explaination:
In step1,
In step2,
In step3,
using htpasswd we are creating the password file ‘my_password_file’ for user ‘admin_user’ and we are specifying password as ‘password’
Reference Links:
http://httpd.apache.org/docs/1.3/programs/htpasswd.html
RSS feed for comments on this post · TrackBack URI
Leave a reply