linux下搭建svn仓库

1、使用yum安装svn

yum -y install subversion

安装完后通过svn help查看是否安装成功

2、创建svn目录仓库

[root@localhost /]# cd /home
[root@localhost home]# mkdir svn
[root@localhost home]# svnadmin create /home/svn
[root@localhost home]# ls svn
conf  db  format  hooks  locks  README.txt

这里我们只需要关注conf文件夹

[root@localhost home]# cd svn/conf
[root@localhost conf]# ls
authz  passwd  svnserve.conf
  • authz 是权限控制文件
  • passwd 是帐号密码文件
  • svnserve.conf 是SVN服务配置文件

3、配置passwd

### 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
test1 = 123456

4、配置authz

# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
[/]
test1=rw
[/test2]
test1=rw
[/test2/test1]
test1=r

我们看到[/]是仓库的一级目录,具有读写的权限;

test2二级目录,也是有读写的权限

test1三级目录,只有读的权限

另外设置分组:

[root@localhost conf]# vi authz
[groups]
group1 = liuxianan
group2 = test1,test2
[/]
@group1 = rw
@group2 = r
* =

5、配置svnserve.conf

[root@localhost conf]# vi svnserve.conf 
打开下面的5个注释
anon-access = read #匿名用户可读
auth-access = write #授权用户可写
password-db = passwd #使用哪个文件作为账号文件
authz-db = authz #使用哪个文件作为权限文件
realm = /home/svn # 认证空间名,版本库所在目录

6、启动svn

[root@localhost conf]# svnserve -d -r /home/svn(启动)
[root@localhost conf]#killall svnserve(停止)

上述启动命令中,-d表示守护进程, -r 表示在后台执行。停止还可以采用杀死进程的方式:

7、客户端连接

不出意外我们就可以通过svn客户端checkout我们的仓库了

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值