红联Linux门户
Linux帮助

apache下设目录身份验证问题

发布时间:2008-12-03 12:22:42来源:红联作者:fqflair
最近想对APACHE服务器设置目录的身份验证,在没设.htaccess的时候能对该目录下的网页进行访问,设置好后也弹出了用户登陆窗口,可输入用户名和密码后就是访问不了页面,大家帮忙看下
这个是 .htaccess的内容
AuthUserFile /apachepasswd/passwd
AuthGroupFile /dev/null/
AuthName "My secret directory"
AuthType Basic
Require valid-user

在根目录下也创建了apachepasswd的文件夹,有htpasswd创建了用户,设置成明文,所以输密码用户的时候绝对是没错的

[root@localhost acltest]# cat /apachepasswd/passwd
web:1

以下是httpd.conf文件改的内容
Alias /acltest "/acltest/"


Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

这个是错误日志
[Wed Dec 03 01:43:17 2008] [error] [client 192.168.16.1] (13)!!!!!!!!: Could not open password file: /apachepasswd/passwd
[Wed Dec 03 01:43:17 2008] [error] [client 192.168.16.1] user web not found: /acltest
[Wed Dec 03 01:50:31 2008] [error] [client 192.168.16.1] user web: authentication failure for "/acltest": Password Mismatch
[Wed Dec 03 01:50:33 2008] [error] [client 192.168.16.1] user web: authentication failure for "/acltest": Password Mismatch
这个是访问时的提示
This server could not verify that you are authorized to access the URL "/acltest". You either supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.
文章评论

共有 2 条评论

  1. fengmx 于 2008-12-04 15:16:44发表:

    不清楚。。

  2. HCH2005 于 2008-12-03 18:59:31发表:

    是不是进passwd文件中改了密码??