09 Dec
Posted by Ganesh H S , Bangalore, India as apache
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,
AuthType Basic
AuthName “Authentification required”
AuthUserFile /var/www/my_password_file
Require user admin_user
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
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Jul | ||||||
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
RSS feed for comments on this post · TrackBack URI
Leave a reply