免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2745 | 回复: 5
打印 上一主题 下一主题

[Web] [配置 验证] 实战apache用户验证 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-09-25 13:57 |只看该作者 |倒序浏览
本文主要介绍了包含在apache发行版本内的用户验证模块---auth,auth_db
验证模块的使用是很简单的就以下三步
1、创建用于保存用户/密码的文件
2、配置apache以使用那个文件做用户验证
3、可选的创建一个组文件
1、apache_1.3.28的安装。
shell>;./configure --prefix=/www --disable-module=all --enable-module=access --enable-module=so --enable-shared=max --enable-module=auth_anon --enable-module=auth --enable-module=auth_db  --enable-module=auth_dbm --enable-module=digest --enable-module=alias --enable-module=log_config --enable-module=dir --enable-module=mime
shell>;make
shell>;make intall
2、创建需要的目录
mkdir /www/auth
mkdir /www/authdb
chown nobody:nobody /www/auth /www/authdb

3、编辑httpd.conf
Alias /auth /www/auth
Alias /authdb /www/authdb
<Directory /www/auth>;
   AllowOverride AuthConfig
</Directory>;
<Directory /www/authdb>;
  AllowOverride Authconfig
</Directory>;
AuthType Basic
4、在/www/auth,/www/authdb中分别创建.htaccess文件
vi /www/auth/.htaccess
AuthName "password file auth"
AuthUserFile /www/authfile/password
AuthGroupFile /www/authfile/group
Require group test
vi /www/authdb/.htaccess
AuthName "db auth"
AuthDBUserFile /www/authfile/dbuser.dat
Require username1

5、创建密码文件
/www/bin/htpasswd -c /www/authfile/password username1
/www/bin/htpasswd /www/authfile/password username2
创建组文件
echo "test: username1 username2" >;>; /www/authfiile/group
6、创建密码数据库用于数据库验证
/www/bin/dbmmanage /www/authfile/dbuser.dat adduser username1

[ 本帖最后由 HonestQiao 于 2006-7-13 21:18 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2003-09-25 17:45 |只看该作者

实战apache用户验证

自己顶一下

论坛徽章:
0
3 [报告]
发表于 2003-09-26 00:56 |只看该作者

实战apache用户验证

Up!

论坛徽章:
0
4 [报告]
发表于 2003-09-27 22:43 |只看该作者

实战apache用户验证

good

论坛徽章:
0
5 [报告]
发表于 2006-07-13 20:56 |只看该作者
好东西呀

论坛徽章:
0
6 [报告]
发表于 2006-07-15 14:49 |只看该作者
支持一下
不过,我觉得疑问的是现在APACHE都apache2.2.2了,LZ怎么
还在用apache1.3?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP