1,下载svn
yum install subversion -y
2,修改svn配置目录,默认是/var/svn ,要求是空目录.
mkdir /mnt/data
cat /etc/sysconfig/svnserve
# OPTIONS is used to pass command-line arguments to svnserve.
#
# Specify the repository location in -r parameter:
#OPTIONS="-r /var/svn"
OPTIONS="-r /mnt/data"
3,创建项目,新项目都可以用svnadmin create /mnt/data/xxxx
svnadmin create /mnt/data/svntest #项目1
svnadmin create /mnt/data/svn2test #项目2
ls svntest/
conf db format hooks locks README.txt
ls svn2test/
conf db format hooks locks README.txt
4,修改配置文件建立svn用户密码
cd /mnt/data/svntest/conf
cat passwd
### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.
[users]
# harry = harryssecret
# sally = sallyssecret
admin = admin # 用户 = 密码
cat 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
# harry_sally_and_joe = harry,sally,&joe
# [/foo/bar]
# harry = rw
# &joe = r
# * =
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
[/]
admin = rw # 用户 = 权限
egrep -v "#|^$" svnserve.conf # 打开anon-access,auth-access,password-db,authz-db注释,注意前面不要有空格。
[general]
anon-access = nine
auth-access = write
password-db = passwd
authz-db = authz
项目2 svn2test
rm -fr /mnt/data/svn2test/conf
cp -a /mnt/data/svntest/ /mnt/data/svn2test/conf
5,启动svn
systemctl start svnserve
检查端口,注意防火墙端口
netstat -ltunp|grep svn
tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN 28913/svnserve
6,客户端拉取svn
linux版本
yum install -y svn
svn checkout svn://192.168.1.35/svntest --username admin --password admin
svn checkout svn://192.168.1.35/svn2test --username admin --password admin
windows版本
下载软件管理,下载svn客户端