其它

subversion

roya · 11月9日 · 2020年

本文记录svn版本控制库安装,采用ldap进行授权,并提供web管理。

1、安装subversion以及相关软件

yum -y install subversion cyrus-sasl cyrus-sasl-lib cyrus-sasl-plain mod_dav_svn php php-ldap

2、修改/etc/sysconfig/saslauthd

# Directory in which to place saslauthd's listening socket, pid file, and so
# on.  This directory must already exist.
SOCKETDIR=/run/saslauthd

# Mechanism to use when checking passwords.  Run "saslauthd -v" to get a list
# of which mechanism your installation was compiled with the ablity to use.
MECH=ldap

# Additional flags to pass to saslauthd on the command line.  See saslauthd(8)
# for the list of accepted flags.
FLAGS=

3、新增文件/etc/saslauthd.conf

注意<ldap_servers><ldap_default_domain><ldap_search_base><ldap_bind_dn><ldap_password>请根据实际情况填写

ldap_servers: ldap://192.168.2.239
ldap_default_domain: amt.com
ldap_search_base: DC=amt,dc=com
ldap_bind_dn: cn=Manager,dc=amt,dc=com
ldap_password: yourpassword
ldap_deref: never
ldap_restart: yes
ldap_scope: sub
ldap_use_sasl: no
ldap_start_tls: no
ldap_version: 3
ldap_auth_method: bind
ldap_mech: DIGEST-MD5
ldap_filter: uid=%u
ldap_password_attr: userPassword
ldap_timeout: 10
ldap_cache_ttl: 30
ldap_cache_mem: 32786

4、重启sasl服务

systemctl restart saslauthd.service

5、验证sasl服务配置是否正确

testsaslauthd -u username -p password

6、新增文件/etc/sasl2/svn.conf

pwcheck_method:saslauthd
mech_list: plain login

7、下载if.svnadmin

wget http://sourceforge.net/projects/ifsvnadmin/files/svnadmin-1.6.2.zip

8、解压

unzip svnadmin-1.6.2.zip

9、移动svnadmin至html下

mv iF.SVNAdmin-stable-1.6.2/ /var/www/html/svnadmin

10、修改/var/www/html/svnadmin所属

chown -R apache:apache /var/www/html/svnadmin/

11、创建svn存储目录

mkdir -p /home/subversion
chown -R apache:apache /home/subversion/

12、创建配置存放目录以及授权文件

mkdir -p /home/subconf
touch /home/subconf/authz
chown -R apache:apache /home/subconf

13、访问http://ip/svnadmin/进行设置

保存设置后选择一个管理用户

14、启动svn服务

svnserve -d -r /home/subversion

15、创建仓库

16、设置访问权限

17、修改仓库的svnserve.conf

anon-access = read
auth-access = write
authz-db = /home/subconf/authz
use-sasl = true

18、设置完成后即可通过svn客户端使用ldap账户对svn进行访问

0 条回应