SubVersion + Apache2.2.4 + OpenLDAP2.3.32 实现权限认证

SubVersion 通过HTTP协议访问代码库,可以通过设置Apache的认证方式来设置访问权限。

这里记载一下相关的配置,特别是mod_authnz_ldap模块的配置,Apache2.0的认证模块为mod_auth_ldap,Apache2.2已经改变为mod_authnz_ldap,配置也有不同:

(1) OpenLDAP的编译安装,版本2.3.32

# cd openldap-2.3.32
# ./configure --prefix=/usr/local/openldap --enable-bdb=no
# make depend
# make
# make install

(2) Apache2.2.4的编译安装,版本2.2.4

需要先编译安装 apr-1.2.8 和 apr-util-1.2.8

# cd apr-1.2.8
# ./configure --prefix=/usr/local/apr
# make
# make install

# cd apr-util-1.2.8
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr --with-ldap --with-ldap-include=/usr/local/openldap/include --with-ldap-lib=/usr/local/openldap/lib
# make
# make install

编译安装好后,开始编译安装Apache2.2.4

# cd httpd-2.2.4
# ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-ldap -- enable-authnz-ldap --enable-dav
# make
# make install

(3) 配置httpd.conf

增加SubVersion的虚拟主机,在httpd.conf里取消下面行的注释:

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

编辑conf/extra/httpd-vhosts.conf文件
< VirtualHost  * : 80 >
    ServerAdmin admin@gehouse.cn
    DocumentRoot 
/ home / svn 
    ServerName svn.gehouse.cn
    ErrorLog logs
/ svn.gehouse.cn - error_log
    LogLevel warn
    CustomLog logs
/ svn.gehouse.cn - access_log common
    
< Location  " / " >  
       AuthBasicProvider ldap
       AuthType Basic
       AuthzLDAPAuthoritative off
       AuthName 
" TianXing Tech IT Server "
       AuthLDAPURL 
" ldap://ldap.gehouse.cn/ou=people,dc=gehouse,dc=cn?cn?sub?(objectClass=*) "  NONE
       Require valid
- user
    
</ Location >
    
< Location  " /sandbox " >
       DAV svn
#       SVNListParentPath on
#       SVNParentPath 
/ home / svn / sandbox
       SVNPath 
/ home / svn / sandbox
#       SVNIndexXSLT 
/ xslt / svnindex.xsl
    
</ Location >
    
< Location  " /projects " >
       DAV svn
       SVNListParentPath on
       SVNParentPath 
/ home / svn / projects
       
< LimitExcept GET PROPFIND OPTIONS REPORT >
          require ldap
- group ou = dev,dc = gehouse,dc = cn
       
</ LimitExcept >
    
</ Location >
</ VirtualHost >

转载于:https://www.cnblogs.com/kylindai/archive/2007/07/19/824037.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值