Centos7 下的SVN安装与配置
Centos7 下的SVN安装与配置
1.关闭防火墙
临时关闭防火墙
systemctl stop firewalld 永久防火墙开机自关闭
systemctl disable firewalld 临时打开防火墙
systemctl start firewalld 防火墙开机启动
systemctl enable firewalld 查看防火墙状态
systemctl status firewalld
2.关闭SELinux
临时关闭SELinux
setenforce 临时打开SELinux
setenforce 查看SELinux状态
getenforce 开机关闭SELinux
编辑/etc/selinux/config文件,如下图,将SELINUX的值设置为disabled。下次开机SELinux就不会启动了。
3.安装svn
yum install subversion
查看版本
[root@heyong ~]# svn --version
svnserve, version 1.7. (r1542130)
compiled Apr , :: 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.
4.创建SVN版本库
在/home下建立一个名为svn的仓库(repository),以后所有代码都放在这个下面,创建成功后在svn下面会多出几个文件夹。
[root@heyong ~]# mkdir -p /home/svn
[root@heyong ~]# svnadmin create /home/svn
[root@heyong ~]# ls /home/svn
conf db format hooks locks README.txt
[root@heyong ~]# cd /home/svn/conf/ [root@heyong conf]# ll
total
-rw-r--r-- root root Oct : authz
-rw-r--r-- root root Oct : passwd
-rw-r--r-- root root Oct : svnserve.conf 其中:
authz 是权限控制文件
passwd 是帐号密码文件
svnserve.conf 是SVN服务配置文件
5.配置passwd(创建用户)
[root@heyong conf]# vim passwd
[users]
test1=
test2=
6.配置authz
[root@heyong conf]# vi authz [/]
admin=rw #对/home/svn/下所有文件具有可读可写权限;
test1=r #只有只读权限;
test2=r #只有只读权限
*= #其它用户均无任何权限
7.使用用户分组
[root@heyong conf]# vi authz [groups]
group1 = admin
group2 = test1,test2 [/]
@group1 = rw #对/home/svn/下所有文件具有可读可写权限;
@group2 = r #只有只读权限;
* = #其它用户无任何权限
8.配置svnserve.conf
[root@heyong conf]# vim svnserve.conf 打开下面的5个注释
anon-access = read #匿名用户可读
auth-access = write #授权用户可写
password-db = passwd #使用哪个文件作为账号文件
authz-db = authz #使用哪个文件作为权限文件
realm = /home/svn # 认证空间名,版本库所在目录
注意:
最后一行的realm记得改成你的svn目录
打开注释时切记前面不要留有空格,否则可能有问题
9.启动与停止
[root@heyong conf]# svnserve -d -r /home/svn(启动) [root@heyong conf]#killall svnserve(停止)
注意:
上述启动命令中,-d表示守护进程, -r 表示在后台执行。停止还可以采用杀死进程的方式
10.客户端连接
TortoiseSVN中使用地址svn://你的IP ,输入用户名和密码就能连接成功。 默认端口3690,如果你修改了端口,那么要记得加上端口号。
修改默认端口
第一种方法:
svnserve -d -r /mnt/svn --listen-port 端口号 第二种方法:
svnserve -d -r /mnt/svn --listen-host IP+端口号
11.启动时遇到的问题
1.启动svnserve时出现cannot bind server socket:address already in use
解决方法:
方法一:找出svnserve id 杀死掉进程
netstat -ntlp
kill - id 方法二:重新指定一个端口号(默认端口3690)
svnserve -d --listen-port 端口号 -r /opt/svndata/repos
2.启动svnserve时出现svnserve.conf:12: Option expected的问题解决方法
svnserve.conf:12: Option expected
解决方法:
因为subversion读取配置文件svnserve.conf时,无法识别有前置空格的配置文件,删除前置空格即可;
如:anon-access = read
3.检查是否启动成功:(查看是否存在svnserve 进程)
[root@heyong svn]# ps -ef|grep svnserve
root : ? :: svnserve -d -r /home/svn
root : pts/ :: grep --color=auto svnserve
12.svn常见路径说明
1.查询安装的包
[root@heyong svn]# rpm -qa|grep subversion
subversion-libs-1.7.-.el7.x86_64
subversion-1.7.-.el7.x86_64
2.svn几个常用目录
/etc 一些设置文件放置的目录
/usr/bin 一些可执行文件
/usr/lib64 一些程序使用的动态函数库
/usr/share/doc 一些基本的软件使用手册与帮助文档
/usr/share/man 一些man page文件
3.列出某些包的具体文件
[root@heyong svn]# rpm -ql subversion-1.7.-.el7.x86_64
/etc/subversion
/etc/sysconfig/svnserve
/run/svnserve
/usr/bin/svn
/usr/bin/svnadmin
/usr/bin/svndumpfilter
/usr/bin/svnlook
/usr/bin/svnrdump
/usr/bin/svnserve
/usr/bin/svnsync
/usr/bin/svnversion
/usr/lib/systemd/system/svnserve.service
Centos7 下的SVN安装与配置的更多相关文章
- CentOS7下NFS服务安装及配置固定端口
CentOS7下NFS服务安装及配置 系统环境:CentOS Linux release 7.4.1708 (Core) 3.10.0-693.el7.x86_64 软件版本:nfs-utils-1. ...
- centos7下git的安装和配置
git的安装: yum 源仓库里的 Git 版本更新不及时,最新版本的 Git 是 1.8.3.1,但是官方最新版本已经到了 2.9.2.想要安装最新版本的的 Git,只能下载源码进行安装. 1. 查 ...
- Centos7下nginx的安装与配置
说明:软件安装的基础目录路径:/usr/local 所以下载软件的时候切换到此目录下下载直接解压即可 1.安装gcc gcc-c++依赖包 yum install -y gcc gcc-c++ 2.下 ...
- CentOS7 下 keepalived 的安装和配置
安装前准备:yum -y install gcc gcc-c++ autoconf automake make yum -y install zlib zlib-devel openssl opens ...
- Centos7下oracle12c的安装与配置(详细)
一.硬件配置 CentOS7@VMware® Workstation 15 Pro,分配资源:CPU:2颗,内存:4GB,硬盘空间:30GB 二.软件准备 linux.x64_11gR2_datab ...
- centos7下postgresql数据库安装及配置
1.安装 #yum install -y postgresql-server 2.postgresql数据库初始化 #service postgresql initdb 3.启动postgresql服 ...
- CentOS7下MariaDB数据库安装及配置
前言 MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可 MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松成为MySQL的代替品.在存 ...
- CentOS7下FTP的安装与配置
1.安装vsftpd 1 [root@localhost modules]# yum install -y vsftpd 2.编辑ftp配置文件 1 [root@localhost modules]# ...
- CentOS7下NFS服务安装及配置
系统环境:CentOS Linux release 7.4.1708 (Core) 3.10.0-693.el7.x86_64 软件版本:nfs-utils-1.3.0-0.48.el7_4.x86_ ...
随机推荐
- SQL查询日期格式化
MARK一下 方便以后自己查阅 举例如下: getdate() 可以替换成日期类型字段 select Convert(varchar(10),getdate(),120) 2006-05-12sele ...
- laravel数据库迁移 和 路由防攻击
命令:php artisan migrate 防攻击:
- day050 前端Jquery库的使用
一.导入jquery文件 <script src=" jquery库文件"></script> 二.选择标签 >>概念明晰: $是jQuery类 ...
- 『Numpy』内存分析_高级切片和内存数据解析
在计算机中,没有任何数据类型是固定的,完全取决于如何看待这片数据的内存区域. 在numpy.ndarray.view中,提供对内存区域不同的切割方式,来完成数据类型的转换,而无须要对数据进行额外的co ...
- 微信小程序textarea组件在fixed定位中随页面滚动
如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true https://developers.weixin.qq.com/miniprogr ...
- Docker容器中找不到vim命令
docker容器中,有的并未安装vi和vim,输入命令vim,会提示vim: command not found(如下图).此时我们就要安装vi命令 执行命令:apt-get update apt-g ...
- vsCode---进行HTML文件编辑与浏览器运行
发现vsCode没有明显的绿色三角箭头指示程序运行. 那么想运行一个html文件咋办,可以直接去文件存放地用浏览器打开便可以了. 但是这样也挺麻烦的, 我们需要在vscode里商城搜索两个插件来支持我 ...
- python 多个脚本
1.增删改查haproxy.conf配置文件 1.查询输入:www.oldboy1.com 2.删除输入:{'backend': 'www.oldboy2.org','record':{'server ...
- Visual Basic 2017 操作Excel和word【2】持续更新……
1.控制台程序创建Excel,并设置状态栏显示“Hello World”文本 Module Module1 Private exitXL As Boolean = False Dim WithEven ...
- java基础知识点学习
基础学习总结 1.锁sync/lock都有哪些方法,底层实现 synchronized ['sɪŋkrənaɪzd] 2.线程池的参数.线程池执行的流程,当到达线程池到达最大数,队列也满了,出现的异常 ...