通过apache配置授权访问目录。

1423阅读 0评论2006-05-30 lazy_bug
分类:LINUX


参考文档:

简单例子:
在/usr/local/www/html/ 建立一个kenlu目录,只有kenlu888这个用户能访问kenlu这个目录,具体配置步骤:
1.编辑httpd.conf
#vi httpd.conf
在其中加入以下内容:
Options Indexes
FollowSymLinks
allowoverride authconfig
order
allow,deny allow from all

2.在kenlu的目录下建立.htaccess文件。
#vi .htaccess
加入如下内容:
AuthName "kenlu888"
AuthType basic
Auth UserFile /usr/local/.htpasswd require valid-user kenlu888

3.为指定的用户激活口令:
#htpasswd -c /usr/local/.htpasswd kenlu888

4.重启apache 进行测试。


上一篇:没有了
下一篇:上海市居住证申办指南