一 权限配置:
/opt/svn/rinms/conf在这个路径下:有三个文件 authz。Password。svnserve
Authz文件
[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
例如:C=XZ (C是XZ的别名)
[groups](这个是进行分组的)
# harry_and_sally = harry,sally(harry_and_sally是组名,harry,sally这两个分别是组写的人员)
# harry_sally_and_joe = harry,sally,&joe
# PLATFORM_KK=XZY,MT
# PLATFORM_Test=ZFP,WB,LX
# [/foo/bar](分配权限的目录)
# [repository:/192.168.1.200](分配权限的版本库下的目录)
# harry = rw(分配用户或者组的权限)
# &joe = r
# * =
# @PLATFORM_KK=rw
# @PLATFORM_Test=r
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
Password中配置用户的密码
[users]
# harry = harryssecret(用户=密码)
# sally = sallyssecret
rinms = rinms
# XZY=XZY
# MT=MT
# ZFP=ZFP
# WB=WB
# LX=LX
Svnsvice文件:设置权限设置是否开放
### 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 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 = 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 = 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
[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
二 添加版本库
如果没有的话,咱们就可以按先手动建立/data/svn/目录
htpasswd -c /data/svn/passwd.conf test
test为用户名
2.创建资料库
首先要创建一个资料库,使用svnadmin增加资料库
cd /usr/local/subversion/bin
./svnadmin create /data/svn/svnroot
3. 到svnroot目录下查看是否多了一些文件,有则说明创建成功。
三 版本库中添加项目
/opt/svn/rinms是版本库的路径
/root/192.168.1.200 为项目目录路径
1. 在已经存在的版本库中添加项目
1.1 /root/192.168.1.200中添加项目 项目文件夹名为test(例如:java文件的整个工程test)
1.2 /opt/svn/rinms下新建一个文件夹,存放test的数据(例如文件夹名为ui_tes)
1.3 然后进行项目添加。 svn import /root/192.168.1.200/test file:///opt/svn/
1.3rinms/ui_test/ --message "init"
1.4 出现如下信息,项目添加成功
Adding /root/192.168.1.200/UI/src/com/enovell/exception/MessageHelper.java
Skipped '/root/192.168.1.200/UI/src/com/enovell/exception/.svn'
Skipped '/root/192.168.1.200/UI/src/com/.svn'
Adding /root/192.168.1.200/UI/.settings
Adding /root/192.168.1.200/UI/.settings/org.eclipse.jdt.ui.prefs
Skipped '/root/192.168.1.200/UI/.settings/.svn'
Adding /root/192.168.1.200/UI/.settings/org.eclipse.core.resources.prefs
Committed revision 1087.
添加项目的小测试
(
我们做个测试,往版本库里添加项目,看看svnserver是否正常工作。
$ cd /tmp
$ mkdir svntest
$ cd svntest
$ mkdir {trunk,branches,tags}
$ svn import . file:///usr/local/repository/svn/test/svntest /
--message "first test project"
Adding trunk
Adding branches
Adding tags
Committed revision 1.
$ svnlook tree /usr/local/repository/svn/test
/
svntest/
trunk/
branches/
tags/
$ cd ../
$ rm -rf svntest
$ svn checkout svn://localhost/test/svntest
A svntest/trunk
A svntest/branches
A svntest/tags
Checked out revision 1.
OK,看来我们的svn已经能正确工作了。
)