分类: LINUX
2015-09-28 18:07:01
1、安装svn服务端
yum install -y subversion
2、创建svn根目录(可以存放有多个svn库)
mkdir -p /home/svn/
3、创建版本库
svnadmin create /home/svn/design
svnadmin create /home/svn/practise
4、配置svnserve.conf(多个库使用同一个配置文件)
cp /home/svn/practise/conf/svnserve.conf /home/svn/svnserve.conf
vi /home/svn/svnserve.conf
在general项下增加以下配置:
anon-access = none
auth-access = write
password-db = /home/svn/passwd
authz-db = /home/svn/authz
realm = svn
5、配置用户密码
vi /home/svn/passwd
配置信息如下(*处自行配置):
[users]
admin = ***
hehe = ***
haha = ***
huhu = ***
6、配置权限
vi /home/svn/authz
配置信息如下:
[groups]
g_admin = admin
g_cpp = haha,hehe
g_web = haha
g_pm = huhu
g_test = huhu
g_design = huhu
g_develop = @g_cpp,@g_web
[/]
@g_admin = rw
[design:/]
@g_admin = rw
@g_design = rw
* = r
[practise:/]
* = rw
7、带参数启动svn
svnserve -d -r /home/svn --config-file=/home/svn/svnserve.conf
8、添加开机启动
echo "/usr/bin/svnserve -d -r /home/svn --config-file=/home/svn/svnserve.conf" >> /etc/rc.d/rc.local