有效地管理源代码的方式是使用工具去帮助我们管理 , SVN(Subversion)就是目前主流的源代码管理工具 , 也称为版本控制工具。

本文主要介绍CentOS6.5上安装SVN服务器,配置SVN服务器的数据仓库,SVN服务的启动查看和停止,SVN服务的开机自启动,安装SVN客户端等内容。

安装SVN

 

1 检查系统是否自带SVN

svnserve –version

如果没有安装,系统会提示svnserve是个无效的命令。

2 安装SVN

yum –y install subversion

3 检查安装是否成功

svnserve –version

返回值:

svnserve, version 1.6.11 (r934486)

compiled Aug 17 2015, 08:37:43

Copyright (C) 2000-2009 CollabNet.

Subversion is open source software, see http://subversion.tigris.org/

This product includes software developed by CollabNet (http://www.Collab.Net/).

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.

创建SVN数据仓库

 

1创建数据仓库

首先创建一个文件夹

mkdir -p /opt/svn/repositories

将创建的文件夹设置为数据仓库

svnadmin create /opt/svn/repositories

执行上面的命令后,自动建立repositories库,查看/opt/svn/repositories 文件夹发现包含了conf,db,format,hooks,locks, README.txt等文件,说明一个SVN库建立完成。

2 配置数据仓库

进入上面生成的文件夹conf下,进行配置

cd /opt/svn/repositories/conf

配置用户名和密码passwd

vi passwd

passwd文件的内容如下:

### This file is an example password file for svnserve.

### Its format is similar to that of svnserve.conf. As shown in the

### example below it contains one section labelled [users].

### The name and password for each user follow, one account per line.

[users]

# harry = harryssecret

# sally = sallyssecret

test = 123456 ##新增用户的用户名和密码

配置权限控制authz

vi authz

目的是设置哪些用户可以访问哪些目录,authz文件的内容如下:

### This file is an example authorization file for svnserve.

### Its format is identical to that of mod_authz_svn authorization

### files.

### As shown below each section defines authorizations for the path and

### (optional) repository specified by the section name.

### The authorizations follow. An authorization line can refer to:

###  - a single user,

###  - a group of users defined in a special [groups] section,

###  - an alias defined in a special [aliases] section,

###  - all authenticated users, using the '$authenticated' token,

###  - only anonymous users, using the '$anonymous' token,

###  - anyone, using the '*' wildcard.

###

### A match can be inverted by prefixing the rule with '~'. Rules can

### grant read ('r') access, read-write ('rw') access, or no access

### ('').

[aliases]

# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

[groups]

# harry_and_sally = harry,sally

# harry_sally_and_joe = harry,sally,&joe

# [/foo/bar]

# harry = rw

# &joe = r

# * =

# [repository:/baz/fuz]

# @harry_and_sally = rw

# * = r

[/]

test = rw

设置[/]代表根目录下所有的资源

配置服务svnserve.conf

vi svnserve.conf

svnserve.conf文件的内容如下:

[general]

#匿名访问的权限,可以是read,write,none,默认为read

anon-access=none

#使授权用户有写权限

auth-access=write

#密码数据库的路径

password-db=passwd

#访问控制文件

authz-db=authz

#认证命名空间,subversion会在认证提示里显示,并且作为凭证缓存的关键字

realm=/opt/svn/repositories

三 SVN服务的启动、查看及停止

 

1 启动svn服务

svnserve -d -r /opt/svn/repositories

2 查看SVN监听的端口

netstat -anp |grep svn

返回:

tcp  0  0 0.0.0.0:3690  0.0.0.0:*  LISTEN  2085/svnserve

3 停止启动SVN

killall svnserve    #停止

设置SVN的开机自启动

 

1 创建svn.sh文件

在/root文件夹下,创建svn.sh文件

cd /root

vi svn.sh

编辑svn.sh文件,加入以下内容

#!/bin/bash

svnserve –d –r /opt/svn/repositories

保存退出

2.添加可执行权限
命令行运行#chmod ug+x /root/svn.sh

3.添加自动运行
打开(vi或gedit)/etc /rc.local,在最后添加一行内容如下:/root/svn.sh保存退出。

4.检查
重启服务器,使用ps-ef看看svn进程是否启动了。以后开机就自动启动svn了。

安装SVN客户端

以业界流行的TortoiseSVN为例,下载地址:

http://sourceforge.net/projects/tortoisesvn/files/latest/download?source=dlp

客户端连接地址:svn://公网或内网的IP地址(如192.168.0.141):3690

用户名/密码: test/123456 
##要和之前设置的用户名和密码匹配。

CentOS 6.5系统上安装SVN服务器的更多相关文章

  1. CentOS 6.5系统上安装SVN服务器端的方法及目录访问权限配置(转总结)

    SVN其实就是Subversion,分为服务器端和客户端.之前在网上搜了很多方法,都有各种问题,经过自己搜集整理以及实际尝试,总算有个比较靠谱的方法.本文主要介绍CentOS 6.5系统上安装SVN服 ...

  2. CentOS 6.5系统上安装SVN服务器端的方法及步骤

    VN其实就是Subversion,分为服务器端和客户端.之前在网上搜了很多方法,都有各种问题,经过自己搜集整理以及实际尝试,总算有个比较靠谱的方法.本文主要介绍CentOS 6.5系统上安装SVN服务 ...

  3. linux系统上安装svn服务器 环境linux+nginx+svnserver

    系统:Ubuntu 12.04 64位 lnmp环境 集成软件:PHP5.4.27.Nginx1.6.0.MySQL5.5.37 阿里云server svnserver有2种执行方式:独立server ...

  4. 在Linux和Windows系统上安装Nginx服务器的教程

    在Linux和Windows系统上安装Nginx服务器的教程  1.在CentOS系统上安装Nginx 在 CentOS6 版本的 EPEL 源中,已经加入了 nginx 的 rpm 包,不过此 RP ...

  5. 在centos6.5上面mount微软系统上安装ftp服务器

    ---恢复内容开始--- 现在用虚拟机开发linux软件,发现虚拟机提供的共享文件夹不能很好地工作,表现为: 1.我在windows上面修改了文件内容,在linux里面发现文件内容没有变化,需要做些等 ...

  6. CentOS 6.5系统上安装MySQL数据库

    1.查看系统是否安装了MySQL      使用命令:      #rpm -qa | grep mysql 2.卸载已安装的MySQL       卸载mysql命令如下:        #rpm ...

  7. 在CentOS6.8系统上安装MySQL5.7(转)

    mysql-57">如何在CentOS 6.8系统上安装MySQL 5.7? 一.检查系统上是否已经安装MySQL 命令: ? 1 2 3 4 5 [root@localhost ~] ...

  8. Centos 7中安装svn服务器,史上最详细

    最近上头安排了帮客户安装svn服务器,用了两种方式安装,yum命令安装,快速简洁容易上手,但是源码安装就比较繁琐,两种方式都试了一下,yum命令基本一个多小时就安装完了,但是源码安装弄了我两天的时间, ...

  9. CentOS 6.4 系统上如何安装 tomcat 8

    CentOS 6.4 系统上如何安装 tomcat 8 本文将详细讲解在Linux系统上如何安装tomcat,tomcat是没有32位和64位之分的. 1.下载tomcat 首先我们肯定要先下载tom ...

随机推荐

  1. Nginx 如何设置反向代理 多服务器,配置区分开来,单独文件保存单个服务器 server 主机名配置,通过 include 实现

    samcao 关注 2015.06.15 10:08* 字数 0 阅读 408评论 0喜欢 0   网络结构如上图.可能你只有一个公网的Ip地址. 但是您的内网有个网站需要映射至外网.而又不想添加其它 ...

  2. Windows下python2与python3兼容设置

    分别安装python2与python3后,我想直接通过命令python2.pip2与python3.pip3区分: 分别进入python安装目录下,修改python.exe为python2.exe.p ...

  3. 动态规划——Remove Boxes

    很久没写博客了,越来越懒了,这次还是要分享LeetCode上一道动态规划的题目,和之前的Ballon Boom那个题(我记得是这个标题吧...)差不多,都是对一个数组的区间进行枚举的题,而且涉及到区间 ...

  4. Vray

    VRay是由chaosgroup和asgvis公司出品,中国由曼恒公司负责推广的一款高质量渲染软件.

  5. PHP 关于判断输入日期是否合法

    合法要求 一年仅十二个月 4,6,9,11月仅30天,1,3,5,7,8,10,12月仅31天 闰年2月29天,否则28天 输入的变量年,月,日为数字 代码: <?php //PHP中判断输入的 ...

  6. Python-杂物

    1,and和or 在一个bool and a or b语句中,当bool条件为真时,结果是a:当bool条件为假时,结果是b. a = "heaven" b = "hel ...

  7. JDBC连接Oracle错误ORA-00922: 选项缺失或无效

    以下错误: ORA-00922: 选项缺失或无效 ORA-00922: missing or invalid option 是由于: execute(sql)语句多了个分号 ; 你没看错!!! 在sq ...

  8. mysql错误:The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement解决方法

    本文为大家讲解的是mysql错误:The MySQL server is running with the --skip-grant-tables option so it cannot execut ...

  9. vuejs小白入门

    后端做不好,是时候学习一下前端了,听说在很流行vue,那么久跟风学习一波. unbuntu下安装npm,然后安装node,这应该算是开发工具或者执行引擎吧. 感觉web前端框架怎么变,都是对html, ...

  10. Servlet 自定义标签

    自定义标签 1)用户定义的一种jsp标记,当一个含有自定义标签的jsp页面被jsp引擎编译成servlet时,tag标签被转化成了对一个称为 标签处理类 的对象的操作.于是,当jsp页面被jsp引擎转 ...