安装步骤如下:
1、yum install subversion
2、输入rpm -ql subversion查看安装位置,如下图:
我们知道svn在bin目录下生成了几个二进制文件。
输入 svn –help可以查看svn的使用方法,如下图。

3、创建svn版本库目录
mkdir -p /var/svn/svnrepos
4、创建版本库
svnadmin create /var/svn/svnrepos
执行了这个命令之后会在/var/svn/svnrepos目录下生成如下这些文件

5、进入conf目录(该svn版本库配置文件)
authz文件是权限控制文件
passwd是帐号密码文件
svnserve.conf SVN服务配置文件
6、设置帐号密码
vi passwd
在[users]块中添加用户和密码,格式:帐号=密码,如dan=dan
7、设置权限
vi authz
在末尾添加如下代码:
[/]
dan=rw
w=r
意思是版本库的根目录dan对其有读写权限,w只有读权限。
8、修改svnserve.conf文件
vi svnserve.conf
打开下面的几个注释:
anon-access = read #匿名用户可读
auth-access = write #授权用户可写
password-db = passwd #使用哪个文件作为账号文件
authz-db = authz #使用哪个文件作为权限文件
realm = /var/svn/svnrepos # 认证空间名,版本库所在目录
9、启动svn版本库
svnserve -d -r /var/svn/svnrepos
10、在windows上测试
新建一个测试文件夹,在该文件夹下右键选择 SVN checkout如下图(要事先安装TortoiseSVN):
填写SVN的地址,如下图:

输入密码,如下图:

F&Q
1. SVN 出现option expected的解决方案
svn目录下conf/svnserve.conf配置文件中 开头不能有空格
[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 = /var/svn/svnrepos
本文详细介绍如何在Linux环境下安装Subversion(SVN),并指导如何配置SVN版本库及权限,包括创建版本库目录、设置账号密码、权限分配等关键步骤。
269

被折叠的 条评论
为什么被折叠?



