How to protect html page access with password

View previous topic View next topic Go down

How to protect html page access with password

Post  Admin on Sun Oct 11, 2009 11:31 pm

# vim /etc/httpd/conf/httpd.conf

****
place in under the Directory of virtual host
<Directory "/var/www/virt">
AuthType Basic
AuthName "password protected"
AuthUserFile /etc/httpd/virtpass
require user client2 client3
</Directory>
****

# htpasswd -c /etc/httpd/virtpass client3
# htpasswd /etc/httpd/virtpass client4
# htpasswd /etc/httpd/virtpass client2

#service httpd restart


****client side***
http://virt.virtualhost.com/
username:client4
password:*** >> wont be able to login
username:client2
password:*** >> success
avatar
Admin
Admin

Posts : 32
Join date : 2009-09-13
Age : 31
Location : Chennai

View user profile http://linux.nsguru.com

Back to top Go down

Re: How to protect html page access with password

Post  Admin on Thu Dec 03, 2009 5:28 am

we need to add
allowOverride AuthConfig to the directory
avatar
Admin
Admin

Posts : 32
Join date : 2009-09-13
Age : 31
Location : Chennai

View user profile http://linux.nsguru.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum