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_ ...
随机推荐
- mongodb笔记(三)
1.删除文档(remove()函数) 在执行remove()函数前先执行find()命令来判断执行的条件是否正确,这是一个比较好的习惯. 语法: db.collection.remove( <q ...
- 『TensorFlow』读书笔记_简单卷积神经网络
如果你可视化CNN的各层级结构,你会发现里面的每一层神经元的激活态都对应了一种特定的信息,越是底层的,就越接近画面的纹理信息,如同物品的材质. 越是上层的,就越接近实际内容(能说出来是个什么东西的那些 ...
- [la P5031&hdu P3726] Graph and Queries
[la P5031&hdu P3726] Graph and Queries Time Limit: 10000/5000 MS (Java/Others) Memory Limit: ...
- 浅谈对象的两个方法:Object.keys() ,Object.assign();
1 : Object.keys(obj) 返回给定对象的所有可枚举属性的字符串数组 例子1: var arr = [1, 2, 6, 20, 1]; console.log(Object.keys(a ...
- Python—装饰器详解
装饰器:(语法糖) 本质是函数,它是赋予函数新功能,但是不改变函数的源代码及调用方式 原则: 1.不能修改被装饰函数的源代码 2.不能修改被装饰函数的调用方式 3.函数的返回值也不变 这两点简而言 ...
- 跟随我在oracle学习php(4)
制作html表单 客户端(每个用户的计算机)在浏览网页时,都会向服务器(后台)端索要数据,然后将得 到的数据呈现在浏览器当中.除了索要数据之外,有时客户端也希望能够向服务器端发送 一些数据. 这时我们 ...
- 关于iOSlaunchScreen的尺寸
备注:这里只是个人的观点,有的地方也是copy,多多指教,个人笔记,有侵犯你们版权的地方还望海涵!!! 关于launchImage 的尺寸链接 摘自:http://www.cnblogs.com/Ri ...
- c++ 生成dll文件并调用
2 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18.
- winform 下载
方法一: WebClient webClint = new WebClient(); webClint.DownloadFile(下载文件的路径,下载到本地的地址); 方法二:异步 WebClient ...
- 第一次学习手游开发:Flappy Bird制作
周末有空,学习下手游开发,因为本人压根没有基础,于是找了个视频,跟着教程撸了个Flappy Bird. 感谢 SwiftV课堂 提供的教学视频 源码地址: https://github.com/phe ...