1.安装svn
yum install -y subversion
2.查看svn版本
svnserve --version
3.创建svn文件夹
mkdir /usr/local/software/svn/project/study
4.创建svn版本库
svnadmin create /usr/local/software/svn/project/study
5.修改配置文件(千万注意每一行配置前面不能有空格)
cd /usr/local/software/svn/project/study/conf
vim svnserve.conf
#匿名访问的权限,可以是read、write、none,默认为read,在此因为我要建立我团队的私人版本库,故我设置为none
anon-access=none
#使授权用户有写权限,参数也是如上3个
auth-access=write
#使用哪个文件作为账号文件,在此指定在conf文件里面的另外一个文件passwd
password-db=passwd
#使用哪个文件作为权限文件,在此指定在conf文件里面的另外一个文件authz
authz-db=authz
#认证命名空间,说白了就是版本库的所在目录
realm=/usr/local/sofeware/svn/project/study
6.设置账户
主要是group下添加
### 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
# * =
[/]
root=rw
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
7.设置密码
### 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
root=xxxxxx设置自己的密码
8.启动svn
svnserve -d -r /usr/local/software/svn/project
9.查看svn启动情况
netstat -apn | grep 3690
ps -ef | grep svnserve
10.关闭svn
killall svnserve
11.配置文件
/etc/sysconfig/svnserve
12.查看和配置svn的根路径:
cat /etc/sysconfig/svnserve
13.开机自启动
systemctl enable svnserve.service
14.访问
因为启动的是/…/svn/project,那么访问就是以/…/svn/projetc为根目录进行访问
svn:/ip:3690/study