目录
3. /var/svnrepos/svn0/conf/svnserve.conf
一、安装 SVN
1. 通过 yum 下载并安装
yum install subversion
[root@izbp11tfz245ne0doug99kz ~]# yum install subversion
2. 查看 SVN 版本
svnserve --version
[root@izbp11tfz245ne0doug99kz ~]# svnserve --version
3. 查看 SVN 安装目录
rpm -ql subversion
[root@izbp11tfz245ne0doug99kz ~]# rpm -ql subversion
二、SVN 版本库
1. 创建版本库目录
mkdir /var/svnrepos
为后面创建版本库提供存放位置。
[root@izbp11tfz245ne0doug99kz ~]# mkdir /var/svnrepos
2. 创建版本库
svnadmin create --fs-type fsfs /var/svnrepos/svn0
指定版本库存放的文件结构,有 fsfs 和 dbd,推荐使用 fsfs。
[root@izbp11tfz245ne0doug99kz ~]# svnadmin create --fs-type fsfs /var/svnrepos/svn0
3. 复制版本库配置文件到根目录
3.1 复制用户账户权限管理配置文件
cp /var/svnrepos/svn0/conf/authz /var/svnrepos/conf/
[root@izbp11tfz245ne0doug99kz ~]# cp /var/svnrepos/svn0/conf/authz /var/svnrepos/conf/
3.2 复制用户账号密码管理配置文件
cp /var/svnrepos/svn0/conf/passwd /var/svnrepos/conf/
[root@izbp11tfz245ne0doug99kz ~]# cp /var/svnrepos/svn0/conf/passwd /var/svnrepos/conf/
三、编辑版本库管理及配置文件
1. /var/svnrepos/conf/authz
用户账号权限管理。
1.1 修改内容
[/]
USER1 = rw
USER2 = rw
1.2 完整配置文件内容
### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to:
### - a single user,
### - a group of users defined in a special [groups] section,
### - an alias defined in a special [aliases] section,
### - all authenticated users, using the '$authenticated' token,
### - only anonymous users, using the '$anonymous' token,
### - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').
[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
[/]
USER1 = rw
USER2 = rw
2. /var/svnrepos/conf/passwd
用户账号密码管理。
2.1 修改内容
USER1 = PASSWORD1
USER2 = PASSWORD2
2.2 完整配置文件内容
### 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
USER1 = PASSWORD1
USER2 = PASSWORD2