svn server installation steps

1. Configure yum and check the subversion installation package
1、yum list |grep subversion
2、yum -y install subversion
3. svnserve --version press Enter to display the version description that the installation is successful
 
2. Create svn repository
1、 mkdir -p /mnt/data/svn
2. svnadmin create /mnt/data/svn/moon moon is the name of the repository
 
Three, svnserve configuration file overview
svnserve.conf -- svn service configuration file, which is in the conf directory of the repository directory.
passwd -- user name and password file, the file name is specified in the file svnserve.conf, the default is in the same directory.
authz -- authority configuration file, the file name is also specified in the file svnserve.conf, the default is the same directory.
 
a). The configuration file svnserver.conf file for configuring the svn service
      vi /mnt/data/svn/moon/conf/svnserve.conf
[general]
anon-access = none
auth-access = write
password-db =  /mnt/data/svn/moon/conf/passwd
authz-db = /mnt/data/svn/moon/conf/authz
realm = Moon Repository #This is a reminder
keep
b). Add two access users and passwords
      vi  /mnt/data/svn/moon/conf/passwd
[users]
kyle = 123456
test1 = 123456
keep
Note: Modifications to the user configuration file take effect immediately without restarting the svn service. 
 
c). Configure the authorization file for the new user
     vi / mnt / data / svn / moon / conf / authz
[groups]
admin = kyle
moonDev = test1
[/]
@admin = rw
@moonDev = r
保存
格式说明:
版本库目录格式: 
[<版本库>:/项目/目录] 
@<用户组名> = <权限> 
<用户名> = <权限>
/ 表示对根目录(即/mnt/data/svn/moon目录)下的所有子目录范围设置权限;
[/abc] 表示对资料库中abc项目设置权限;
创建一个admin组,组成员包括xiaoran.shen和test1
创建一个user组,成员只有test2;
admin组对目录有读写权限;
单个用户test2有读写权限;
*=表示除了上面设置的权限用户组以外,其他所有用户都设置空权限,空权限表示禁止访问本目录,这很重要一定要加上。
注意:对权限配置文件的修改立即生效,不必重启svn。 
 
四、启动svn服务
      svnserve -d -r /mnt/data/svn/
 
注意:不要使用系统提供的 /etc/init.d/svnserve start 来启动,因为系统默认的启动脚本中没有使用 –r /mnt/data/svn/参数指定一个资源。这种情况下启动的svn服务,客户端连接会提示“svn: No repository found in 'svn://ip/moon' ”这样的错误。
默认svn服务器端口是3690。
 
五、杀死svn服务:
ps -ef|grep svn
root      4642     1  0 16:08 ?        00:00:00 svnserve -d -r /mnt/data/svn/
root      4692  3676  0 16:13 pts/2    00:00:00 grep svn
kill -9 4642

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326332671&siteId=291194637