2012年4月9日 星期一

Apache web Authentication

Reference: http://httpd.apache.org/docs/2.0/howto/auth.html

1. edit /etc/httpd/conf/httpd.conf

<Directory />
    Options FollowSymLinks
    AllowOverride AuthConfig
    AuthType Basic
    AuthName "Restricted Files"
    AuthUserFile /etc/httpd/conf/passwd
    Require valid-user
</Directory>

2. create password file by command htpasswd
htpasswd -c /etc/httpd/conf/passwd account1

3. create other accounts
htpasswd /etc/httpd/conf/passwd account2

沒有留言:

張貼留言