Centos7 配置subversion
CentOS7:配置SVN服务器
Posted on 2016-11-10 15:17 eastson 阅读(4266) 评论(0) 编辑 收藏
</div>
<div class="postbody"><div id="cnblogs_post_body"><h3>1. 安装</h3>
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/svnserveOPTIONS 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,应该就可以了。



</div>
</td>
参考文章: http://www.cnblogs.com/eastson/p/6050710.html
Centos7 配置subversion的更多相关文章
- 三·管理和配置Subversion(基于Centos7)
基于上一篇文章 二·安装Subversion(基于Centos7)中安装的Subversion,本篇文章讲述Subversion的管理和配置 1.添加环境变量 输入命令vi /etc/profile ...
- Centos7 配置网络步奏详解
Centos7 配置网络步奏详解 编辑网卡配置文件 vi /etc/sysconfig/network-script/ifcfg-ens01 备注:这里的ens01不是所有系统都叫这个,有的可能叫其他 ...
- Linux 安装配置Subversion edge
2014-04-14:修正部分描述.添加JAVA_HOME报错处理步骤.添加配置sudoers 系统:CentOS 5.8 ,6.4 Subversion版本:Subversion Edge 4.0. ...
- centos7配置开启无线网卡,重启防火墙
centos7配置无线网卡: 在虚拟机为nat的网络连接下(就是默认的那个),centos7默认网卡未激活. 可以设置 文件 /etc/sysconfig/network-scripts/ifcfg- ...
- Centos7配置JAVA_HOME
Centos7配置JAVA_HOME http://blog.csdn.net/zzpzheng/article/details/73613838 在Centos7上,通过yum install ja ...
- Centos7配置NFS
centos7配置nfs yum -y install nfs-utils rpcbind 设置服务开机启动: systemctl enable rpcbind systemctl enable nf ...
- Centos7 配置ssh连接
Centos7 配置ssh连接 1.检查是否安装openssh-server:#yum list installed | grep openssh-server 安装openssh-server:#y ...
- CentOS7 配置静态 ip
1. 为 CentOS7 配置静态 ip 1.1 修改文件/etc/sysconfig/network-scripts/ifcfg-ens33 sudo vi /etc/sysconfig/netwo ...
- virtualbox 最小化安装centos7 配置双网卡(nat和桥接)记录----已经过期
该文章已经过期 请参考另一篇文章:virtualbox 安装centos7 配置桥接网卡,实现主机和虚拟机互通,虚拟机可以访问外网,解决无法上网问题 先说明一下为什么要配置双网卡? 配置nat ...
随机推荐
- Ethereum Learning Materials
Home 注:本页为 EthFans 站内文章精选集.鉴于文章的采集范围较广,我们无法保证文章内容没有重复,也不能保证排列的顺序实现了最优的认识路径.我们只能说,这些文章是我们精挑细选后,确认可以长期 ...
- Linux创建连接命令 ln -s创建软连接
ln -s 是linux中一个非常重要命令,一定要熟悉.它的功能是为某一个文件在另外一个位置建立一个同不的链接,这个命令最常用的参数是-s, 具体用法是:ln -s 源文件 目标文件. 当 我们需要在 ...
- auto的用法
用法参考链接:https://blog.csdn.net/arrowyl/article/details/80886515 Codeblocks 出现'auto' changes meaning in ...
- MYSQL双查询错误1
一.基础知识 开始讲解MYSQL双查询错误之前,我们先了解一下双查询语句以及需要使用到的几个数据库函数和GROUP BY语句 1. 双查询语句 先了解一下什么是子查询,子查询就是嵌入第一层select ...
- C++中宏的定义与用法(现已被内联函数所代替)
在noip中,宏还是被经常采用,所以这里讲一下,C++中宏的定义与用法 第一种用法——配合条件编译:#define DEBUG 定义一个叫DEBUG的标识符.它应该与#ifdef或#ifndef配合使 ...
- 【代码总结】PHP之会话跟踪技术
有些时候感觉自己学习的效率好低,一套教程一本书,反复听,反复看,反复敲代码.自学这条路真的是很艰难,在任何事情都没有成功之前都很枯燥乏味.自学的过程中总会遇到很多问题,有时候连错误的原因都找不出来,那 ...
- idea开发web项目${pageContext.request.contextPath}无法转义
web-app版本问题,我的web.xml中头文件的配置是: <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web ...
- 15. 深入解析Pod对象(二):使用进阶
15. 深入解析Pod对象(二):使用进阶 15.1 Projected Volume,投射数据卷 备注:Projected Volume 是 Kubernetes v1.11 之后的新特性 在 Ku ...
- 吴裕雄--天生自然Numpy库学习笔记:NumPy 切片和索引
ndarray 数组可以基于 0 - n 的下标进行索引,切片对象可以通过内置的 slice 函数,并设置 start, stop 及 step 参数进行,从原数组中切割出一个新数组. import ...
- Cisco AP-Mobility Express基础
Part I 介绍 1.1基本概况 Cisco Mobility Express这个名词出现在Cisco “8”系列的AP上,例如现在的AP1852,AP2802,AP3802等都是Mobility ...