Monday, 20 June 2011

Authentication, Authorization, and Access Control Through Apache





 htpasswd -c /usr/bin/passwd santosh ------> to create a htacceess user and passwd file

 htpasswd /usr/bin/passwd amit  --------->to create a htacceess user

cd /var/www/html/
ls -l

ls -l | grep amit

mkdir amit   ----------> amit is directory to be allowed password access

cd amit

vi test.txt
vi /etc/httpd/conf/httpd.conf

ls -l /usr/bin/passwd
chown apache:apache /usr/bin/passwd
service httpd restart
vi /etc/httpd/conf/httpd.conf


search for /Directory

there make this entry

 Authtype Basic
AuthName "Validate Yourself"
AuthUserFile /usr/bin/passwd
Require user amit  ----->here you can specify username to whom you want to allow access   and you can also use  <Require valid-user>


save and exit

service httpd restart

No comments:

Post a Comment