CentOS架设SVN服务器[非与apache结合]

下载SVN源码并安装
# cd /myvps/downloads
# wget http://subversion.tigris.org/downloads/subversion-1.6.17.tar.gz
# wget http://subversion.tigris.org/downloads/subversion-deps-1.6.17.tar.gz
# tar -zxvf subversion-1.6.17.tar.gz
# tar -zxvf subversion-deps-1.6.17.tar.gz
# cd subversion-1.6.17
# ./configure --prefix=/myvps/servers/svn1.6.17
# make
# make install


配制SVN服务器(红色部份可用于添加新仓库)
# cd /myvps/svndb
# mkdir -p {repository,etc}
# svnadmin create /myvps/svndb/repository/STFramework
# svnadmin create /myvps/svndb/repository/test


配制仓库
配置STFramework仓库
进入仓库目录
# cd /myvps/svndb/repository/STFramework

修改配置
你可以直接删除默认的svnserve.conf文件,然后使用下面的配置:
# vi svnserve.conf

[general]
anon-access = none
auth-access = write
password-db = /myvps/svndb/repository/etc/passwd
authz-db = /myvps/svndb/repository/etc/authz
realm = STFramework
说明:
anon-access = none #不允许匿名用户访问
auth-access = write #通过验证的用户可以读和写
password-db = /myvps/svndb/repository/etc/passwd #用户保存文件
authz-db = /myvps/svndb/repository/etc/authz #权限管理文件
realm = STFromework #仓库名称

配置test仓库(红色的为必要修改的部份)
# cp /myvps/svndb/repository/STFramework /myvps/svndb/repository/test
# cd /myvps/svndb/repository/test
# vi svnserve.conf

[general]
anon-access = none
auth-access = write
password-db = /myvps/svndb/repository/etc/passwd
authz-db = /myvps/svndb/repository/etc/authz
realm = test

配制权限(帐号密码配制省略)
# vi /myvps/svndb/repository/etc/authz

[groups]
gadmin=xxx1
gdev=xxx2,xxx3

[STFramework:/]
@gadmin = rw
@gdev = r
* =

[test:/]
@gadmin = rw
@gdev = rw
* =

启动SVN服务
svnserve -d -r /myvps/svndb/repository

你可能感兴趣的:(CentOS架设SVN服务器[非与apache结合])