4、 创建版本库:
a) 使用 TortoiseSVN 创建版本库
i. 在版本库根中新建一个文件夹
ii. 进入新建的文件夹,右键菜单中选择 TortoiseSVN-> 在此创建版本库
b) 使用命令创建版本库
i. 在版本库根中新建一个文件夹,如 test
ii. 打开命令提示符输入
svnadmin create D:\svnhome\test
c) 配置版本库权限
i. 进入新创建的版本库中的 conf 文件夹中,现在有 3 个文件,分别是:
1. authz :权限配置信息
2. passwd :用户配置信息
3. svnserve.conf :版本库配置信息
ii. svnserve.conf 说明:
# 这个文件主要定义版本库的安全设置
[general] # 匿名访问权限,可设定值: write , read , none anon-access = none # 通过验证权限,可设定值: write , read , none auth-access = write # 密码文件路径 password-db = passwd.conf # 版本库中的文件夹的访问权限的文件路径 authz-db = authz.conf # 版本库真是名称 realm = MyFirstRepository
# 以下内容尚未研究透彻 #[sasl] ### This option specifies whether you want to use the Cyrus SASL ### library for authentication. Default is false. ### This section will be ignored if svnserve is not built with Cyrus ### SASL support; to check, run 'svnserve --version' and look for a line ### reading 'Cyrus SASL authentication is available.' # use-sasl = true ### These options specify the desired strength of the security layer ### that you want SASL to provide. 0 means no encryption, 1 means ### integrity-checking only, values larger than 1 are correlated ### to the effective key length for encryption (e.g. 128 means 128-bit ### encryption). The values below are the defaults. # min-encryption = 0 # max-encryption = 256 |
iii. passwd :
# 这个文件主要定义用户与用户密码
# 格式为:用户名 = 密码 [users] harry=harry sally=sally admin=admin |
iv. authz :
# 这个文件主要定义用户或用户群组对版本库中的文件夹的访问权限
# 定义别名 # # 注:别名的定义与使用方法未知 [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,admin harry_sally_and_joe = harry,sally,admin,&joe
# 授予对库内文件夹的操作权限 # # / :代表版本库跟目录 # # 权限名称: # r :读取 # rw :读写 # _( 空 ) :无权限 # # 格式为:用户名 \@ 群组 \& 别名 = 权限名称 # 注:别名的定义与使用方法未知 # [/] harry = rw admin = rw &joe = r #@harry_and_sally = rw * =
# 作用未知 [repository:/] @harry_and_sally = rw * = r
|
5、 访问版本库:
a) svn 方式: svn://localhost/test (test 对应创建的版本库的文件夹名称 )
b) http 方式:需要配置 Apache 服务器