subversion的安装与多项目权限配置笔记

1:安装过程,这里采用了yum的方式安装,编译的话有点麻烦。

[root@localhost data]# yum install subversion

执行以下的命令:

svn --version

如果显示

svn, version 1.6.11 (r934486)

之类的信息,那么代表安装成功了。

2、建立版本库

首先我们建立一个文件夹来专门存放svn项目,如下

[root@localhost data]# mkdir /data

我们使用命令建立两个项目:

1[root@localhost data]# svnadmin create /data/onethink 2[root@localhost data]# svnadmin create /data/p2

此时会在文件夹/data/下面生成两个项目onethink和p2,目录结构如下:

1drwxr-xr-x. 6 root root 4096 May 23 22:10 onethink 2drwxr-xr-x. 6 root root 4096 May 24 01:06 p2

每个项目的目录结构如下:

1drwxr-xr-x. 2 root root 4096 May 24 01:15 conf 2drwxr-sr-x. 6 root root 4096 May 24 01:24 db 3-r--r--r--. 1 root root    2 May 24 01:06 format 4drwxr-xr-x. 2 root root 4096 May 24 01:06 hooks 5drwxr-xr-x. 2 root root 4096 May 24 01:06 locks 6-rw-r--r--. 1 root root  229 May 24 01:06 README.txt

其中 conf 文件夹中的三个文件为svn的配置文件,包括:

1-rw-r--r--. 1 root root 1093 May  7 06:41 authz 2-rw-r--r--. 1 root root  320 May  7 06:39 passwd 3-rw-r--r--. 1 root root 2259 May  7 06:43 svnserve.conf

其中authz为权限文件,passwd为用户验证文件,svnserve.conf为项目配置文件。为了方便我们把authz passwd这两个文件独立开来,成为每个项目的公用权限和验证文件。我们把它们放在/data/conf目录下。

此时的目录结构如下:

1drwxr-xr-x. 2 root root 4096 May 24 01:26 conf 2drwxr-xr-x. 6 root root 4096 May 23 22:10 onethink 3drwxr-xr-x. 6 root root 4096 May 24 01:06 p2 4 5[root@localhost data]# ll conf onethink/ p2/ 6conf: 7total 8 8-rw-r--r--. 1 root root 1031 May 24 01:24 authz 9-rw-r--r--. 1 root root  338 May 23 22:08 passwd 10 11onethink/: 12total 24 13drwxr-xr-x. 2 root root 4096 May 23 22:56 conf 14drwxr-sr-x. 6 root root 4096 May 24 01:18 db 15-r--r--r--. 1 root root    2 May 23 21:50 format 16drwxr-xr-x. 2 root root 4096 May 23 21:50 hooks 17drwxr-xr-x. 2 root root 4096 May 23 21:50 locks 18-rw-r--r--. 1 root root  229 May 23 21:50 README.txt 19 20p2/: 21total 24 22drwxr-xr-x. 2 root root 4096 May 24 01:15 conf 23drwxr-sr-x. 6 root root 4096 May 24 01:24 db 24-r--r--r--. 1 root root    2 May 24 01:06 format 25drwxr-xr-x. 2 root root 4096 May 24 01:06 hooks 26drwxr-xr-x. 2 root root 4096 May 24 01:06 locks 27-rw-r--r--. 1 root root  229 May 24 01:06 README.txt

接下来我们配置用户名及密码

打开/data/conf/passwd文件,增加两个用户

1[root@localhost conf]# cat passwd  2### This file is an example password file for svnserve. 3### Its format is similar to that of svnserve.conf. As shown in the 4### example below it contains one section labelled [users]. 5### The name and password for each user follow, one account per line. 6 7[users] 8# harry = harryssecret 9# sally = sallyssecret 10tttt = 111111  #用户1 11tttt2 = 111111   #用户2

接着我们设置项目onethink和p2下面的conf/svnserve.conf文件,令到它可以使用公共的/data/conf/passwd及/data/conf/authz

1anon-access = none //无权限时 2auth-access = write //有权限时 3### The password-db option controls the location of the password 4### database file.  Unless you specify a path starting with a /, 5### the file's location is relative to the directory containing 6### this configuration file. 7### If SASL is enabled (see below), this file will NOT be used. 8### Uncomment the line below to use the default password file. 9password-db = /data/conf/passwd //所使用的用户密码文件 10### The authz-db option controls the location of the authorization 11### rules for path-based access control.  Unless you specify a path 12### starting with a /, the file's location is relative to the the 13### directory containing this file.  If you don't specify an 14### authz-db, no path-based access control is done. 15### Uncomment the line below to use the default authorization file. 16authz-db = /data/conf/authz //权限管理文件 17### This option specifies the authentication realm of the repository. 18### If two repositories have the same authentication realm, they should 19### have the same password database, and vice versa.  The default realm 20### is repository's uuid. 21realm = p2 //貌似这个叫什么来着?

配置好后,我们还需要配置/data/conf/authz权限管理文件

1[groups] 2g1 = tttt #用户组1 3g2 = tttt2 #用户组2 4 5[onethink:/] #onethink项目的权限设置 6@g1 = rw #onethink项目组,用户组1是有读写的 7@g2 = #onethink项目组,用户组2是没有任何权限的 8 9[p2:/] #p2项目组的权限,同上 10@g2= rw 11 12[p2:/txt] #配置p2项目下的txt文件夹的权限,这里用户组2是没有权限的 13@g2=

配置好后,我们启动svn服务

[root@localhost conf]# svnserve -d -r /data/

这时我们在window环境下就可以使用软件来访问了,两个项目的访问地址分别为

svn://192.168.110.129/p2

svn://192.168.110.129/onethink

点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

java将前端的json数组字符串转换为列表

记录下在前端通过ajax提交了一个json数组的字符串,在后端如何转换为列表。前端数据转化与请求varcontracts{id:'1',name:'yanggb合同1'},{id:'2',name:'yanggb合同2'},{id:'3',name:'yang

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )