LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1181|回复: 0

求问:使用htdbm为何不能实现对Apache目录的访问验证?

[复制链接]
发表于 2009-6-26 21:33:08 | 显示全部楼层 |阅读模式
rt!

实验平台为:winxp做host OS、centos5.3做guest OS

安装Apache版本:httpd-2.2.8-jason.3

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
AuthType Basic
AuthName "Top Secret"
AuthDBMType default
AuthDBMUserFile /etc/httpd/dbhtpasswds
#AuthDBMGroupFile /etc/httpd/dbusergrouplist
Require user is_mysql
#Require group usergroup1
</Directory>

使用htdbm来增加用户
htdbm -c /etc/httpd/dbhtpasswds is_mysql
输入两遍密码


401错误
Authorization Required

This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser

doesn't understand how to supply the credentials required.

查看httpd的错误日志:
tail /var/log/httpd/error_log

[Fri Jun 26 20:59:08 2009] [error] [client 192.168.1.10] access to / failed, reason: verification of user id 'is_mysql' not configured



但是

htdbm -l /etc/httpd/dbhtpasswds
返回
Dumping records from database -- /etc/httpd/dbhtpasswds
    Username                        Comment
    is_mysql
Total #records : 1

怪哉!到底是为什么呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表