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

Easter79
• 阅读 489

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

[root@localhost data]# yum install subversion

执行以下的命令:

svn --version

如果显示

svn, version 1.6.11 (r934486)

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

2、建立版本库

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

[root@localhost data]# mkdir /data

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

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

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

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

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

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

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

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

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

此时的目录结构如下:

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

[root@localhost data]# ll conf onethink/ p2/
conf:
total 8
-rw-r--r--. 1 root root 1031 May 24 01:24 authz
-rw-r--r--. 1 root root  338 May 23 22:08 passwd

onethink/:
total 24
drwxr-xr-x. 2 root root 4096 May 23 22:56 conf
drwxr-sr-x. 6 root root 4096 May 24 01:18 db
-r--r--r--. 1 root root    2 May 23 21:50 format
drwxr-xr-x. 2 root root 4096 May 23 21:50 hooks
drwxr-xr-x. 2 root root 4096 May 23 21:50 locks
-rw-r--r--. 1 root root  229 May 23 21:50 README.txt

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

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

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

[root@localhost conf]# cat 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
tttt = 111111  #用户1
tttt2 = 111111   #用户2

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

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/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/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 = p2 //貌似这个叫什么来着?

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

[groups]
g1 = tttt #用户组1
g2 = tttt2 #用户组2

[onethink:/] #onethink项目的权限设置
@g1 = rw #onethink项目组,用户组1是有读写的
@g2 = #onethink项目组,用户组2是没有任何权限的

[p2:/] #p2项目组的权限,同上
@g2= rw

[p2:/txt] #配置p2项目下的txt文件夹的权限,这里用户组2是没有权限的
@g2=

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

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

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

svn://192.168.110.129/p2

svn://192.168.110.129/onethink

点赞
收藏
评论区
推荐文章
blmius blmius
2年前
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
Wesley13 Wesley13
2年前
java将前端的json数组字符串转换为列表
记录下在前端通过ajax提交了一个json数组的字符串,在后端如何转换为列表。前端数据转化与请求varcontracts{id:'1',name:'yanggb合同1'},{id:'2',name:'yanggb合同2'},{id:'3',name:'yang
Jacquelyn38 Jacquelyn38
2年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
Stella981 Stella981
2年前
Linux下安装SVN服务(CentOS7下)
1\.安装centos(我这里使用的是CentOS7)下yum命令即可方便的完成安装$ sudo yum install subversion测试安装是否成功:$ svnserve version2\.建立版本库创建svn数据目录(subversion默认是把/var/svn作为数据根目录的,开
Stella981 Stella981
2年前
Linux上svn的安装配置
1.安装svn1.yum y install subversion  2.建立版本库目录并配置1.mkdir p /var/www/svndata  2.svnserve d r /var/www/svndata  3.建立版本库:创建一个新的Subversion项目
Wesley13 Wesley13
2年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
2年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Wesley13 Wesley13
2年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
3个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这
Easter79
Easter79
Lv1
今生可爱与温柔,每一样都不能少。
文章
2.8k
粉丝
5
获赞
1.2k