linux(centos)搭建SVN服务器

安装步骤如下:
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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值