2007年3月16日星期五

HowTo protect a directory in the apache

HowTo protect a directory in the apache
Modify the httdp.conf file add below code.
<Directory "/var/www/html/phplive/super">
        Options Indexes
        AllowOverride authconfig
        order allow,deny
        allow from all
</Directory>
[root@devtest1 super]# vi .htaccess
AuthType Basic
AuthUserFile  /var/www/html/phplive/super/.pass
AuthName "admin"
require valid-user
[root@devtest1 super]# htpasswd -c .pass admin
New password:
Re-type new password:
Adding password for user admin
restart the apache to activate.
Your sincere,
------------
Henry Zhu
2007-03-16

没有评论: