svn 配置多个仓库和权限控制

在前面的文章中,Shop是一个仓库,如果同时开发多个项目,就要建立多个仓库,同时进行多个项目监管
svnserve只可以监管一个文件夹,不可以监管多个仓库。

可以通过监管总目录来达到监管所有仓库的目的
比如Shop仓库的总目录是 WebApp
切换到WebApp目录,执行
svnserve -d -r ./即可
这样我们就可以通过svn://localhost访问WebApp了
如果要访问Shop目录,就是svn://localhost/Shop

但是如果更改了localhost的指向,那么之前靠这个指向的检出目录就会无法连接了


权限控制
仓库资源文件下
conf文件夹里面
authz文件 授权文件 告诉那些用户具有那些权限
passwd文件 认证文件 标志某个仓库具有那些用户和相应的密码

svnserve.con 核心配置文件

anon-access = write

auth-access = write

第一个是匿名权限
第二个是认证权限

password-db = passwd
authz-db = authz
去掉注释
,这样就开启了授权文件和认证文件

接着编写认证文件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
#定义用户admin和huang密码分别是admin和1995
admin = admin  
huang = 1995

然后编辑authz文件

### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to:
###  - a single user,
###  - a group of users defined in a special [groups] section,
###  - an alias defined in a special [aliases] section,
###  - all authenticated users, using the '$authenticated' token,
###  - only anonymous users, using the '$anonymous' token,
###  - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').

[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
#组名=用户名
admin = admin 
kaifa = huang,admin



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

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

[Shop:/]
@admin = rw  #admin组有读写权限
@check = r   #check组有读权限
* = r        #其他只有读权限





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值