2.2.3 配置source2仓库
# cd /opt/svn/repos/source2
2.2.4 修改配置
你可以直接删除默认的svnserve.conf文件,然后使用下面的配置:
# vi svnserve.conf
[general]
anon-access = none
auth-access = write
password-db = /opt/svn/etc/svn-user.conf
authz-db = /opt/svn/etc/svn-authz.conf
realm = My Second Repository
如果有更多的仓库,可以类推配置。
----------------------------------------------------------------------
svnserve.conf的原始内容:
### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository. (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)
### Visit http://subversion.tigris.org/ for more information.
[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 = read
# 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 conf directory.
### Uncomment the line below to use the default password file.
# password-db = 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 conf
### directory. 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 = 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 = My First Repository
----------------------------------------------------------------------
3 用户及权限管理
3.1 用户管理
3.1.1 创建用户存储文件
# vi /opt/svn/etc/svn-user.conf
3.1.2 设置用户帐号
[users]
harry = harryssecret
sally = sallyssecret
bote = botessecret
说明:
[users] #是必须的,标记为用户配置开始
harry = harryssecret # harry 是用户名 , harryssecret是密码。注意,是明文密码
sally = sallyssecret # 同上
bote = botessecret # 同上
往后所以仓库的用户都在这里记录就可以了。至于那个用户,允许访问那个仓库,在权限管理里限制。
3.2 权限管理
3.2.1 创建权限管理文件
# vi /opt/svn/etc/svn-authz.conf
3.2.1 设置权限管理
[groups]
source1 = harry
source2 = sally
[source1:/]
@source1 = rw
@source2 = r
[source2:/]
@source2 = rw
bote = rw