CentOS服务器安装配置svn环境

云服务器:阿里云CentOS7.3 64

svn版本控制在各大公司还是占主导地位的,也有很多实用gitlab搭建;后续也会写一篇gitlab的搭建。今天主要以yum方式安装svn。

一、yum安装svn

[root@sihan ~]# yum install -y subversion
[root@sihan ~]# svnserve --version
svnserve, version 1.7.14 (r1542130)
   compiled Apr 11 2018, 02:40:28

Copyright (C) 2013 The Apache Software Foundation.
This software consists of contributions made by many people; see the NOTICE
file for more information.
Subversion is open source software, see http://subversion.apache.org/

The following repository back-end (FS) modules are available:

* fs_base : Module for working with a Berkeley DB repository.
* fs_fs : Module for working with a plain file (FSFS) repository.

Cyrus SASL authentication is available.

二、创建SVN版本库及版本库目录

[root@sihan ~]# mkdir -p /usr/svn/repo
[root@sihan ~]# svnadmin create /usr/svn/repo

三、修改svn的配置文件

需要注意的是配置文件都需要顶行,前面不能有空格,不然会报错的。

[root@sihan ~]# vim /usr/svn/repo/conf/svnserve.conf 
#匿名用户没有权限
anon-access = none
#授权用户可写(包含可读)
auth-access = write
#使用哪个文件作为账号文件
password-db = passwd
#使用哪个文件作为权限文件
authz-db = authz
#认证空间名,版本库所在目录
realm = /usr/svn/repo

四、设置svn的账号密码

[root@sihan ~]# vim /usr/svn/repo/conf/passwd 
### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.
[users] 
test= 123456

五、设置svn的账号权限

[root@sihan ~]# vim /usr/svn/repo/conf/authz 

在末尾添加如下代码,表示test用户拥有更目录的读写权限

[/]
test=rw

六、启动svn版本库

-d 表示svnserve.exe 将会作为一个服务程序运行在后台
-r表示把/usr/svn/repo目录作为根目录

[root@sihan ~]# svnserve -d -r /usr/svn/repo  --listen-port=3690 

注意:这里启用了3690作为svn版本库的端口,一般新服务器是没有对此端口开放的,所以需要自行上云提供商后台配置安全组规则,开放3690端口。

svn://127.0.0.1:3690/repo

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值