yum install -y subversion
/非必须(可以在已有目录目录下创建,不用一定要自己建目录)mkdir -p /application/svndata (数据存储根目录)
mkdir -p /application/svnpasswd(用户密码权限目录)
svnserve 命令
-d 守护进程模式(后台运行)
-r 存储根目录
--pid-file 存储pid号
服务启动
svnserve -d -r /application/svndata/
ps -ef |grep svn
netstat -lntup|grep 3690
创建版本库
svnadmin 命令
svnadmin create /application/svndata/sadoc
cd /application/svndata/sadoc/conf/
cp svnserve.conf svnserve.conf.ori
vi svnserve.conf
#anon-access = read
#auth-access = write
变为
anon-access = none #不允许匿名访问
auth-access = write
#password-db = passwd变为
password-db = /application/svnpasswd/passwd #为了统一管理
#authz-db = /application/svnpasswd/authz变为
authz-db = /application/svnpasswd/authz
结果
[root@openstack1 conf]# diff svnserve.conf svnserve.conf.ori
19,20c19,20
< anon-access = none
< auth-access = write
---
> # anon-access = read
> # auth-access = write
27c27
< password-db = /application/svnpasswd/passwd
---
> # password-db = passwd
34c34
< authz-db = /application/svnpasswd/authz
---
> # authz-db = authz
//
cp passwd authz /application/svnpasswd/
cd /application/svnpasswd/
chmod 700 * //安全,ldap也行
vi passwd
更改svnserve.conf需要爱重启,passwd和authz不需要重启
vi authz
组名=用户名1,用户名2
[<版本库>:/项目/目录]
@<用户组名>=<权限>
<用户名>=<权限>
sagroup = test,test1
[sadoc:/]
@sagroup = r
test = w
重启:
pkill svnserve
svnserve -d -r /application/svndata/