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是否安装成功。
![](http://common.cnblogs.com/images/copycode.gif)
$ 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.
![](http://common.cnblogs.com/images/copycode.gif)
2. 建立版本库
subversion默认以/var/svn作为数据根目录,可以通过/etc/sysconfig/svnserve修改这个默认位置。
![](http://common.cnblogs.com/images/copycode.gif)
$ 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"
![](http://common.cnblogs.com/images/copycode.gif)
我们修改/etc/sysconfig/svnserver将默认目录指定到/opt/svn。
$ cat /etc/sysconfig/svnserve
OPTIONS="-r /opt/svn"
使用svnadmin建立版本库spring-hello-world。
![](http://common.cnblogs.com/images/copycode.gif)
$ 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
![](http://common.cnblogs.com/images/copycode.gif)
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:
![](http://common.cnblogs.com/images/copycode.gif)
$ 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 #指定版本库的认证域,即在登录时提示的认证域名称
![](http://common.cnblogs.com/images/copycode.gif)
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检查服务器的防火墙配置:
![](http://common.cnblogs.com/images/copycode.gif)
$ firewall-cmd --list-all
public (default, active)
interfaces: eno16777736 eno33554984
sources:
services: dhcpv6-client ssh
ports:
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
![](http://common.cnblogs.com/images/copycode.gif)
可以看到,没有telnet服务和3690端口。增加telnet服务器和3690端口:
$ sudo firewall-cmd --permanent --add-service=telnet
$ sudo firewall-cmd --permanent --add-port=/tcp
$ sudo firewall-cmd --reload
客户端再用telnet,应该就可以了。
![](https://images2017.cnblogs.com/news/24442/201710/24442-20171024183729457-421799845.jpg)
![](https://images2017.cnblogs.com/news/24442/201710/24442-20171027070203758-1397753435.jpg)
</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 ...
随机推荐
- Linux的一些命令(CentOS7)
注:下面的文件名和文件夹名字都支持通配符 init 0:关机 init 6:重启 clear:清屏 ip addr:查看ip地址 passwd 用户名:修改指定用户的密码 时间相关的命令: date: ...
- Qt QML Component 学习笔记
简介 Component是Qt封装好的.只暴露必要接口的QML类型,可以重复利用.一个QML组件就像一个黑盒子,它通过属性.信号.函数和外部世界交互. 一个Component既可以定义在独立的QML文 ...
- P3368 (模板)树状数组2
借这个题学新姿势,这个题需要利用差分才能AC,普通树状树有3个点过不了. 差分原理(参考题解区大佬): 一个例子,一组数据 $ a[] = { 1, 5, 4, 2, 3 } $,差分后得到 $ b[ ...
- JS-原生的ajax
记录一下: //post需要设置请求头 setRequestHeader(name, value)name //头部的名称:这个参数不应该包括空白.冒号或换行 //value 头部的值:这个参数不应该 ...
- LeetCode练题——53. Maximum Subarray
1.题目 53. Maximum Subarray——Easy Given an integer array nums, find the contiguous subarray (containin ...
- Linux - Windows下的Linux工具
1. putty, 2. winscp(可下载文件) 3. SecureCRT
- 校准产品质量,把控出海航向,腾讯WeTest《2019中国移动游戏质量白皮书》正式开放预约
作者:wetest小编 商业转载请联系腾讯WeTest获得授权,非商业转载请注明出处. 原文链接:https://wetest.qq.com/lab/view/483.html 每当步入一个新的年份, ...
- 9000端口号被上一个ip地址占用,需要reboot才可以恢复正常ip端口问题
比如查看端口# lsof -i:9000 本机ip已经修改为192.168.0.50,而经过# lsof -i:9000查看到,端口是这样的,192.168.0.88:9000,显示的还是上一个ip的 ...
- python中的type和object详解
关于这篇博客 这篇博客主要描述Python的新风格对象(new-style objects),如下: <type 'type'>和<type 'object'>分别是什么? 用 ...
- StringUtils中isEmpty方法和isBlank方法的区别
1.StringUtils.isEmpty没有忽略空格参数,是以是否为空和是否存在为判断依据. 示例: StringUtils.isEmpty("yyy") = false Str ...