CentOS7:配置SVN服务器
1. 安装
CentOS通过yum安装subversion。
$ sudo yum install subversion
subversion安装在/bin目录:
$ which svnserve
/bin/svnserve
检查一下subversion是否安装成功。
$ svnserve --version
svnserve, version 1.7. (r1542130)
compiled Nov , :: Copyright (C) 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.
2. 建立版本库
subversion默认以/var/svn作为数据根目录,可以通过/etc/sysconfig/svnserve修改这个默认位置。
$ systemctl cat svnserve.service
# /usr/lib/systemd/system/svnserve.service
[Unit]
Description=Subversion protocol daemon
After=syslog.target network.target [Service]
Type=forking
EnvironmentFile=/etc/sysconfig/svnserve
ExecStart=/usr/bin/svnserve --daemon --pid-file=/run/svnserve/svnserve.pid $OPTIONS [Install]
WantedBy=multi-user.target $ cat /etc/sysconfig/svnserve
# OPTIONS is used to pass command-line arguments to svnserve.
#
# Specify the repository location in -r parameter:
OPTIONS="-r /var/svn"
我们修改/etc/sysconfig/svnserver将默认目录指定到/opt/svn。
$ cat /etc/sysconfig/svnserve
OPTIONS="-r /opt/svn"
使用svnadmin建立版本库spring-hello-world。
$ sudo mkdir -p /opt/svn
$ sudo svnadmin create /opt/svn/spring-hello-world $ ll /opt/svn/
drwxr-xr-x. root root Nov : spring-hello-world $ ll /opt/svn/spring-hello-world/
drwxr-xr-x. root root Nov : conf
drwxr-sr-x. root root Nov : db
-r--r--r--. root root Nov : format
drwxr-xr-x. root root Nov : hooks
drwxr-xr-x. root root Nov : locks
-rw-r--r--. root root Nov : README.txt
3. 配置
编辑用户文件passwd,新增两个用户:admin和guest。
$ cat /opt/svn/spring-hello-world/conf/passwd
[users]
admin = admin
guest = guest
编辑权限文件authz,用户admin设置可读写权限,guest设置只读权限。
$ cat /opt/svn/spring-hello-world/conf/authz
[/]
admin = rw
guest = r
编辑svnserve.conf:
$ cat /opt/svn/spring-hello-world/conf/svnserve.conf
[general]
anon-access = none #控制非鉴权用户访问版本库的权限
auth-access = write #控制鉴权用户访问版本库的权限
password-db = passwd #指定用户名口令文件名
authz-db = authz #指定权限配置文件名
realm = spring-hello-world #指定版本库的认证域,即在登录时提示的认证域名称
4. SVN服务
启动SVN服务。
$ sudo systemctl start svnserve.service
检查服务是否启动成功。
$ ps aux | grep svn
root 0.0 0.1 ? Ss : : /usr/bin/svnserve --daemon --pid-file=/run/svnserve/svnserve.pid -r /opt/svn
通过netstat可以看到SVN打开了3690端口。
$ sudo netstat -tnlp
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0.0.0.0: 0.0.0.0:* LISTEN /svnserve
设置成开机启动。
$ sudo systemctl enable svnserve.service
5. 客户端测试
客户端可以通过TortoriseSVN测试。

这时候可能会防火墙问题。如果是防火墙问题,会提示无法连接。

客户端用telnet无法连接。
C:\Temp>telnet 192.168.12.59
用systemctl检查服务器的防火墙配置:
$ firewall-cmd --list-all
public (default, active)
interfaces: eno16777736 eno33554984
sources:
services: dhcpv6-client ssh
ports:
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
可以看到,没有telnet服务和3690端口。增加telnet服务器和3690端口:
$ sudo firewall-cmd --permanent --add-service=telnet
$ sudo firewall-cmd --permanent --add-port=/tcp
$ sudo firewall-cmd --reload
客户端再用telnet,应该就可以了。

CentOS7:配置SVN服务器的更多相关文章
- CentOS7 配置SVN服务器
也可以参考这里:https://jingyan.baidu.com/article/148a1921d84be34d71c3b18f.html 1.安装svn yum install -y subve ...
- CentOS7 搭建 SVN 服务器
CentOS7 搭建 SVN 服务器 介绍SVN: SVN是Subversion的简称,是一个开放源代码的版本控制系统,相较于RCS.CVS,它采用了分支管理系统,它的设计目标就是取代CVS.互联网上 ...
- centos7 搭建svn服务器
1.安装svn服务器: yum install subversion 2.配置svn服务器: 建立svn版本库根目录及相关目录即svndata及密码权限命令svnpasswd: mkdir -p /a ...
- centos7下SVN服务器如何搭建
Centos7 搭建svn服务器 linux(centos)下SVN服务器如何搭建?说到SVN服务器,想必大家都知道,可以是在LINUX下如何搭建SVN服务器呢?那么今天给大家分享一下linux(ce ...
- centos7 搭建svn服务器&客户端的访问&备份迁移
当今用于版本控制的软件程序主要的有svn和git,其它软件咱不熟悉,今天记录下搭建svn服务器和svn客户端使用: 使用环境:虚拟机为centos7系统,svn服务器安装在centos7系统平台上,s ...
- centos7搭建svn服务器及客户端设置
centos7搭建svn服务器及客户端设置 centos7貌似预装了svn服务(有待确认),因此我们直接启动该服务即可 一.svn服务端配置(服务器IP假设为192.168.100.1) 步骤1:创建 ...
- 如何配置svn服务器
如果你已经安装好了VisualServer服务器,现在让我们一起来配置svn服务器吧. 工具/原料 VisualServer 配置VisualServer 找到VisualServer Manager ...
- 如何配置svn服务器(通过VisualServer服务器)
如果你已经安装好了VisualServer服务器,现在让我们一起来配置svn服务器吧
- CentOS 7下搭建配置SVN服务器
CentOS 7下搭建配置SVN服务器 1. 安装 CentOS通过yum安装subversion. $ sudo yum install subversion subversion安装在/bin目录 ...
- linux 配置svn服务器+使用+注意事项
本文以ubuntu系统进行安装. 1.安装svn服务器 apt-get install subversion 输入 y 回车确认安装. 安装完毕后可以用 下边的命令查看是否安装完成,如果现实出版本号和 ...
随机推荐
- python操作mysql数据库的相关操作实例
python操作mysql数据库的相关操作实例 # -*- coding: utf-8 -*- #python operate mysql database import MySQLdb #数据库名称 ...
- java 读写properties
网速不好:先贴上资料: Java配置文件Properties的读取.写入与更新操作 [Spring] - Property注入 http://www.360doc.com/content/14/073 ...
- google 版本号49之后chrome的跨域设置
- C堆栈入门
原文:http://student.csdn.net/link.php?url=http://www.top-e.org%2Fjiaoshi%2Fhtml%2F427.html 格式和部分内容稍作修改 ...
- new 与 malloc 的区别
1, 申请内存所在的位置 new 操作符从自由存储区上为对象动态分配内存空间,而 malloc 函数从堆上动态分配内存.自由存储区是C++基于 new 操作符的一个抽象概念,而堆是操作系统中的术语,是 ...
- C 语言中的优先级
先看一段代码: /********************************************************************* * @fn bdAddr2Str * * ...
- android studio入门
目前的工作是蓝牙相关的,所以最近心血来潮想折腾下Android开发,方便调试自己的固件, 装好Android Studio跟SDK之后,感谢nordic的公开代码,研究了一会,感觉并没有多费劲 相关的 ...
- Date 对象中的 getYear 和 getFullYear方法
生成一个新的日期对象 : var someDate=new Date(); 获取日期月份中的天数: var date=someDate.getDate(); 获取 4 位数的年份: var year= ...
- python-program
程序需要一步步改进,解决bug,尽量从源头判断,并给出处理措施. 1.客户端执行一次,程序就退出, 2.客户端空值,错误命令,程序会死掉 3.收发缓冲区大小,即recv(1024)的问题,如果收一个1 ...
- yii2的form表单样式怎么灵活控制呢?
<?php $form = ActiveForm::begin(['id' => 'login-form', 'fieldConfig'=>[ 'template'=> &qu ...