配置Apache支持以支持多种验证方式并存

应用场景
吉之特测试组提出的需求,新建mercurial用户,建立虚拟用户,用于版本控制工具认证,执行某个公用操作。

主要配置参数

1
2
3
4
5
AuthType            Authentication type being used. Mostly , it will be set to Basic
AuthName            The authentication realm or name
AuthUserFile    The location of the password file
AuthGroupFile   The location of the group file, if any Require The requirement(s) which must be satisfied in order to grant admission
AuthBasicProvider       Sets the authentication provider(s) for this location.It will be set to  dbm, file, dbd, and ldap.


示范配置
(/etc/httpd/conf/httpd.conf)

1
2
3
4
5
6
7
8
9
10
AllowOverride None
AuthName mercurial
AuthType Basic
AuthBasicProvider ldap file #Enable相关的认证方式
AuthLDAPURL "ldap://dc2008.woobest.com/cn=Users,dc=woobest,dc=com?sAMAccountName?sub?(objectClass=user)"
AuthLDAPBindDN ldap_pub
AuthLDAPBindPassword ******** #LDAP认证相关
Require valid-user
AuthBasicAuthoritative off
AuthUserFile /etc/httpd/virtual.users #文本数据库认证相关

用户名和密码使用htpasswd生成

1
2
3
4
# htpasswd -c /usr/local/apache/passwd/passwords public_hg
New password: mypassword
Re-type new password: mypassword
Adding password for user public_hg
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值