LinuxSir.cn,穿越时空的Linuxsir!

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

通过.htaccess实现页面认证时遇到的问题?

[复制链接]
发表于 2003-7-1 12:02:48 | 显示全部楼层 |阅读模式
软件环境:
Red Hat Linux 9
Apache 2.0.40(默认安装)

1.修改 /etc/httpd/conf/httpd.conf

<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
将其中的AllowOverride None改为AllowOverride AuthConfig

2.在/var/www/html目录下建立.htaccess文件,并写入
AuthType Basic
AuthName "test"
AuthUserFile /var/www/html/password
Require user test

3.执行htpasswd -cb /var/www/html/password test a
(用户名:test 密码:a)

4.重启Apache

5.在浏览器中输入http://127.0.0.1时,弹出一个 ... 户名以及密码
可是当我输入正确的用户名和密码后却被告之"用户名或密码不正确,请重新输入",随后显示如下信息:
Authentication required!


        This server could not verify that you are authorized to access the URL "/". You either supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.
In case you are allowed to request the document, please check your user-id and password and try again.
If you think this is a server error, please contact the webmaster


Error 401

127.0.0.1
2003脛锚07脭脗01脠脮 ?脟脝脷露镁 11脢卤30*脰52脙毛
Apache/2.0.40 (Red Hat Linux)


我反复试了多次都是如此,请问我是不是哪里出错了??
发表于 2003-7-1 12:46:58 | 显示全部楼层
/var/www/html/password 的权限是多少.
chmod +755 /var/www/html/password 试试
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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