svn多项目配置

之前版本更新都是用pssh无密码传输+脚本实现,这样更新不仅麻烦,而且容错率很低,现在使用svn后不仅方便快捷,而且版本能够回滚,大大提高了容错率。

svn多项目配置如下:

服务器端

1.yum -y install subversion

[app1101098741@VM_146_209_tlinux /data/newxdlq/svn]$ svn --version
svn,版本 1.6.11 (r934486)
   编译于 Sep 27 2011,15:29:25


版权所有 (C) 2000-2009 CollabNet。
Subversion 是开放源代码软件,请参阅 http://subversion.tigris.org/ 站点。
此产品包含由 CollabNet(http://www.Collab.Net/) 开发的软件。

2.新建一个目录用于存放svn管理的所有项目

mkdir -p /data/svn

3.新建一个版本仓库,如果多个项目的话可以建多个,现已lqwc为例

svnadmin create /data/svn/lqwc

4.初始化版本仓库

svn import lqwc file:///data/svn/lqwc -m "init svn"

5.添加用户

vim /data/svn/lqwc/conf/passwd

[users]
# harry = harryssecret
# sally = sallyssecret
xy_test = xy_test

6.修改用户访问策略(此处建了一个管理组)

vim /data/svn/lqwc/conf/authz

[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
xy_admin = xy_test

# [/foo/bar]
# harry = rw
# &joe = r
# * =

[lqwc:/]
@xy_admin = rw
* =

最后一行*=表示,除了上面设置了权限的用户组外,其他任何人都被禁止访问本目录

7.修改 svnserve.conf文件,让用户和策略配置生效

vim /data/svn/lqwc/conf/svnserve.conf

[general]
### These options control access to the repository for unauthenticated
### and authenticated users.  Valid values are "write", "read",
### and "none".  The sample settings below are the defaults.
anon-access = none
auth-access = write

### The password-db option controls the location of the password
### database file.  Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = /data/newxdlq/svn/lqwc/conf/passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control.  Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file.  If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = /data/newxdlq/svn/lqwc/conf/authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa.  The default realm
### is repository's uuid.
realm = /data/newxdlq/svn/lqwc

8.启动服务器

svnserve -d -r /data/svn

默认启动的时3690端口,如果要改为其他端口使用svnserve -d -r /data/svn --listen-port 8000

9.测试服务器

svn co --username xy_test --password xy_test svn://192.168.1.2/lqwc  /root/svntest


windows客户端选择

TortoiseSVN图形化界面

Slik-Subversion DOS下下通过代码执行,可以配合计划任务


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值