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服务器的更多相关文章

  1. CentOS7 配置SVN服务器

    也可以参考这里:https://jingyan.baidu.com/article/148a1921d84be34d71c3b18f.html 1.安装svn yum install -y subve ...

  2. CentOS7 搭建 SVN 服务器

    CentOS7 搭建 SVN 服务器 介绍SVN: SVN是Subversion的简称,是一个开放源代码的版本控制系统,相较于RCS.CVS,它采用了分支管理系统,它的设计目标就是取代CVS.互联网上 ...

  3. centos7 搭建svn服务器

    1.安装svn服务器: yum install subversion 2.配置svn服务器: 建立svn版本库根目录及相关目录即svndata及密码权限命令svnpasswd: mkdir -p /a ...

  4. centos7下SVN服务器如何搭建

    Centos7 搭建svn服务器 linux(centos)下SVN服务器如何搭建?说到SVN服务器,想必大家都知道,可以是在LINUX下如何搭建SVN服务器呢?那么今天给大家分享一下linux(ce ...

  5. centos7 搭建svn服务器&客户端的访问&备份迁移

    当今用于版本控制的软件程序主要的有svn和git,其它软件咱不熟悉,今天记录下搭建svn服务器和svn客户端使用: 使用环境:虚拟机为centos7系统,svn服务器安装在centos7系统平台上,s ...

  6. centos7搭建svn服务器及客户端设置

    centos7搭建svn服务器及客户端设置 centos7貌似预装了svn服务(有待确认),因此我们直接启动该服务即可 一.svn服务端配置(服务器IP假设为192.168.100.1) 步骤1:创建 ...

  7. 如何配置svn服务器

    如果你已经安装好了VisualServer服务器,现在让我们一起来配置svn服务器吧. 工具/原料 VisualServer 配置VisualServer 找到VisualServer Manager ...

  8. 如何配置svn服务器(通过VisualServer服务器)

    如果你已经安装好了VisualServer服务器,现在让我们一起来配置svn服务器吧

  9. CentOS 7下搭建配置SVN服务器

    CentOS 7下搭建配置SVN服务器 1. 安装 CentOS通过yum安装subversion. $ sudo yum install subversion subversion安装在/bin目录 ...

  10. linux 配置svn服务器+使用+注意事项

    本文以ubuntu系统进行安装. 1.安装svn服务器 apt-get install subversion 输入 y 回车确认安装. 安装完毕后可以用 下边的命令查看是否安装完成,如果现实出版本号和 ...

随机推荐

  1. The long way

    转眼毕业一年多了,经历的好复杂,从PHP转到了C++,回到了老本行. 虽然PHPDE各种框架已经很熟了,但是仍然感觉这不是我想要的. 回到C++,才发现这才是自己的方向,心也跟着静了下来. 但是莫名的 ...

  2. Word Break II

    Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each ...

  3. 类似baidu搜索 修正jquery的autocomplete在firefox下不支持中文输入法的bug

    解决方法:

  4. hhvm之轻进程

    本文为原创,转载请注明:http://www.cnblogs.com/gistao/ 背景 我们在aws上部署了hhvm,高峰段发现cpu idle降的比较低,只有10-20%,而使用php-fpm的 ...

  5. RGB与HSV颜色空间

    RGB颜色空间 1.三基色原理:大多数的颜色可以通过红.绿.蓝三色按照不同的比例合成产生,同样绝大多数单色光也可以分解成红绿蓝三种色光    红绿蓝三基色按照不同的比例相加合成混色称为相加混色.其中一 ...

  6. TYVJ 1117 BFS

    无限WA..参考了一下题解和同学写的....... 可以在bfs的基础上改一下.. 读入的时候平地权值是2 草地是0 bfs的时候如果搜到的是平地,那么直接加入,如果搜到的是草地,那么记录是草地. 从 ...

  7. js中属性和方法的类型和区别

    对象的属性:私有属性(var).类属性(静态属性).对象属性(this).原型属性(prototype). 对象的方法: 私有方法(funtion).类方法(静态方法).对象方法(this).原型方法 ...

  8. HDU-2243 考研路茫茫——单词情结(AC自动机)

    题目大意:给n个单词,长度不超过L的单词有多少个包含n个单词中的至少一个单词. 题目分析:用长度不超过L的单词书目减去长度在L之内所有不包含任何一个单词的书目. 代码如下: # include< ...

  9. Python检测IP合法 是否为公网IP

    判断IP 格式是否正确 def check_value(self, ipaddr): '''检查IP是否合法 :param ipaddr: string :return True ''' addr=i ...

  10. s2 devMode cmdshell

    s2 devMode cmdshell   仅支持批量验证,命令执行 链接:http://pan.baidu.com/s/1sl7tgRV 密码:wud8 也可以通过outscan一键获取,之后导入t ...