Home > Uncategorized > Password authenticate for webpage using apache

Password authenticate for webpage using apache

April 8, 2008

Mới vừa build MTRG xong, ale..hup!

Sẵn có document chỉ setup password authenticate -> làm luôn.

Cách làm như sau:

1. touch /var/members/.htaccess

2. vi /etc/httpd/conf/httpd.conf

<Directory “/var/www/html/mrtg”>
Options FollowSymLinks
AllowOverride AuthConfig
</Directory>

3. vi /var/www/html/mrtg/.htaccess

AuthName “MRTG Graphs/Html restricted access”
AuthType Basic
AuthUserFile /var/members/.htpasswd
Require user admin

4. htpasswd -c /var/members/.htaccess admin

5. restart apache.

Categories: Uncategorized Tags: , , , , ,
%d bloggers like this: