zoukankan      html  css  js  c++  java
  • 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>

  • 相关阅读:
    要回家了,想到以后..
    面试应注意的问题by JohnPhilips(转自matrix论坛)
    在痛苦中坚持,翻译啊
    数据抓取和分析~~
    不考研,就很闲吗?
    在Swing中使用高级的MVC和POJOs
    测试驱动
    开始找工作了,先记个流水帐
    又是开学的时候了
    开发者想要什么算是我的翻译作品的处女作吧,呵呵,致力于英语学习..
  • 原文地址:https://www.cnblogs.com/kylindai/p/824037.html
Copyright © 2011-2022 走看看