天天看点

centos搭建svn服务器centos搭建svn服务器

centos搭建svn服务器

1.安装subversion

yum install -y subversion

2.配置svn服务器目录默认路径/var/svn

vim /etc/sysconfig/svnserve
OPTIONS="-r /svn"
           

3.使用svnadmin建立版本库

mkdir -p /svn

svnadmin create /svn/test

[[email protected] /]# ll /svn/test
总用量 8
drwxr-xr-x. 2 root root  54 11月 14 12:51 conf 
drwxr-sr-x. 6 root root 253 11月 14 11:49 db
-r--r--r--. 1 root root   2 11月 13 10:21 format
drwxr-xr-x. 2 root root 231 11月 13 10:21 hooks
drwxr-xr-x. 2 root root  41 11月 13 10:21 locks
-rw-r--r--. 1 root root 229 11月 13 10:21 README.txt
           

4.配置权限

ll /svn/test/conf
总用量 12
-rw-r--r--. 1 root root 1139 11月 13 10:53 authz
-rw-r--r--. 1 root root  377 11月 13 10:27 passwd
-rw-r--r--. 1 root root 3080 11月 14 12:51 svnserve.conf
           
vim /svn/test/svnserve.conf
anon-access = none
auth-access = write
password-db = passwd #密码配置
authz-db = authz #权限配置
realm = test
[sasl]
           
vim /svn/test/passwd
[users]
harry = harryssecret
           
vim /svn/test/authz
[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

[groups]
harry_and_sally = harry,sally
# [repository:/]
# @harry_and_sally = rw
# * = r
[test:/]
@harry_and_sally = rw
           

5.启动svn服务器

  • 方式一
svnserve -d -r /svn/
  • 方式二
systemctl start svnserve.service

最后祝大家生活愉快。

继续阅读