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 ...
随机推荐
- redis 字符串操作
redis 字符串创建SET操作 127.0.0.1:6379> set number "10086" OK 127.0.0.1:6379> set book &quo ...
- python 读取一个文件夹下的所jpg文件保存到txt中
最近需要使用统计一个目录下的所有文件,使用python比较方便,就整理了一下代码. import os def gci(filepath): files = os.listdir(filepath) ...
- 360安全浏览器已经完成和统一操作系统UOS的适配工作
导读 统信软件公司宣布,360安全浏览器已经完成和统一操作系统UOS的适配工作.如今,基于龙芯.兆芯.飞腾.海光等国产CPU的统一操作系统UOS,赢全面支持电子公文.电子签章.流版式办公插件等近百款国 ...
- 远程服务器返回错误: 404错误、远程服务器返回错误:500错误、 HttpWebResponse远程服务器返回错误:(404、500) 错误。
现象 我们编码实现请求一个页面时,请求的代码类似如下代码: HttpWebRequest req = (HttpWebRequest)WebRequest.Create(strUrl);req.Use ...
- centos7.5下安装jenkins
最近从头搭建了一套python+selenium+pytest+allure+Jenkins的环境,虽然网上挺多的,不过还是记录下来,毕竟坑还是挺多的....... 先从搭建jenkins开始把! 方 ...
- 区块链学习——HyperLedger-Fabric v1.0 启动过程分析
本章我们从fabric v1.0的e2e_cli示例开始分析整个启动过程以及在过程中的一些配置文件 首先呢,还是确保你的基本环境已经搭建完成,v1.0源码和镜像也都下载完毕 fabric启动过程中的相 ...
- C的精神
信任程序员 不要妨碍程序员做需要做的事 保持语言精练简单 只提供一种方法执行一项操作 让程序运行更快, 即使不能保证其可移植性 在最后一点上, 标准委员会的用意是: 作为实现, 应该针对目标计算机来定 ...
- 【代码审计】appcms 文件包含漏洞
index.php的开头系统都做了过滤 一个是 htmlspecialchars($v), 另一个是/^[\x{4e00}-\x{9fa5}\w {0}]+$/u. 前一个过滤是把预定义的字符 &qu ...
- 快速创建vue 项目
随着VUE 技术的不断更新,越来越多的开发者开始使用vue编写前端界面,今天我就和大家分享一下 ,如何快速创建一个vue项目. 前提: 安装了node.js 首先: 全局安装vue-cli 使用命令: ...
- Java学习资源 - 其他
http请求HttpServletRequest详解 HttpServletRequest请求转发 高并发场景下的httpClient优化使用 HttpClien高并发请求连接池 - PoolingH ...