1、安装subversion(client and server)

$ yum install subversion
$ yum install mod_dav_svn

安装成功之后使用 svnserve --version 看一下安装的版本

[root@localhost conf]# 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.6.11,是一个老旧的版本了,官网上的版本已经是1.9.4,先不纠结这个问题,先用这个老版本

2、代码库创建

SVN软件安装完成后还需要建立SVN库,我将svn库的路径设在了/var/www/svn/game/test/下面

mkdir -p /var/www/svn/game/test
svnadmin create /var/www/svn/game/test

创建成功之后可以cd到这个目录看看

[root@localhost test]# ll
total 24
drwxr-xr-x. 2 root root 4096 Aug 18 18:13 conf
drwxr-sr-x. 6 root root 4096 Aug 18 03:07 db
-r--r--r--. 1 root root2 Aug 18 01:21 format
drwxr-xr-x. 2 root root 4096 Aug 18 01:21 hooks
drwxr-xr-x. 2 root root 4096 Aug 18 01:21 locks
-rw-r--r--. 1 root root 229 Aug 18 01:21 README.txt

目录结构创建如上,创建成功。

3、配置代码库

cd到/var/www/svn/game/test/conf下面

svnserve.conf(### This file controls the configuration of the svnserve daemon, if you use it to allow access to this repository.)

passwd(### This file is an example password file for svnserve.)

authz(### This file is an example authorization file for svnserve.)

vi svnserve.conf,在[general]下面追加或者打开注释

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

anon-access=none

使授权用户有写权限

auth-access=write

密码数据库的路径

password-db=passwd

访问控制文件

authz-db=authz

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

realm=/opt/svn/repositories

PS:在[general]后面追加,我一开始看教程的时候,直接加在了文件的最后面,发现用户权限怎么都没有生效,查了好久才找到问题所在。

用户密码passwd配置 编辑passwd文件即可,内容很简单,username=passwd

权限控制authz配置,直接附上原文

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

4、相关命令

  1. 查看svn是否运行 ps -ef|grep svn|grep -v grep
  2. 停止SVN命令 killall svnserve
  3. 启动svn版本库 svnserve -d -r 目录名
  4. 如果目录名不同,svn的链接也不同。
  5. 如果我使用svnserve -d -r /var/www/svn/game/test

    则svn的地址为:svn://ip

    如果我使用svnserve -d -r /var/www/svn/

    则svn的地址为:svn://ip/game/test

5、后续

这种直接用svnserve运行的

CentOS搭建SVN记录的更多相关文章

  1. [记录]CentOS搭建SVN服务器(主从同步)

    CentOS搭建SVN服务器(主从同步)1.安装步骤如下: 1)安装: #yum install subversion 2)查看安装位置: #rpm -ql subversion 3)查看版本: #/ ...

  2. Linux(CentOS)搭建SVN服务器全攻略

    虽然在windows上搭建SVN很简单,但是效能却不高,这当然是和linux相比了.然而在linux上搭建SVN却非常繁琐,所以今天这篇文章就来一步一步教您如何在Centos上搭建SVN 安装#yum ...

  3. 使用Linux(CentOS)搭建SVN服务器全攻略

    虽然在windows上搭建SVN很简单,但是效能却不高,这当然是和linux相比了.然而在linux上搭建SVN却非常繁琐,所以今天这篇文章就来一步一步教您如何在Centos上搭建SVN 安装 #yu ...

  4. CentOS搭建SVN服务器,并通过Apache HTTP方式访问

    摘要:本文主要讲述了在centos 6.5环境下搭建svn服务器,可通过svn:\\IP方式访问.同时由于部分公司内网端口限制,并不能访问外网的svn服务器,所以特地结合了apache服务器,使得可以 ...

  5. 【svn】Centos搭建svn服务器环境

    1.需求描述 在Centos系统中搭建svn服务器环境 2.搭建过程 2.1 yum安装svn [root@localhost /]# yum install svn  2.2 新建目录存储svn目录 ...

  6. CentOS 搭建 SVN 服务器 及使用教程

    服务器与客户端 1.搭建SVN服务器 ① CentOS安装SVN 命令: yum -y install subversion 检查是否安装成功 命令: svn --version 如果显示如下内容说明 ...

  7. centos搭建SVN三部曲

    搭建SVN服务,有效的管理代码,以下三步可以快速搞定. 1.安装 #yum install subversion 判断是否安装成功 #subversion -v svnserve, version 1 ...

  8. Centos搭建SVN服务器三步曲

    搭建SVN服务,有效的管理代码,以下三步可以快速搞定.1.安装 #yum install subversion 判断是否安装成功#subversion -v svnserve, version 1.6 ...

  9. centos搭建svn服务器

    1.在centos6.5上面搭建svn服务器,安装svn服务器:yum install subversion 2.在任意目录下创建仓库目录,这里放在/data/mypros目录下 3.执行命令:svn ...

随机推荐

  1. c++中的继承与初始化

    1.在c++中构造函数.析构函数.=运算符.友元无法继承 2.const 成员.引用成员.类的对象成员没有默认构造函数时,需在类的构造函数初始化列表中对其进行初始化 3.基类无默认构造函数,派生类需在 ...

  2. C# 调用webservice 几种办法(转载)

    原文地址: http://www.cnblogs.com/eagle1986/archive/2012/09/03/2669699.html //=========================== ...

  3. No.23

    腓利比书3:19:"他们的结局就是沉沦,他们的神就是自己的肚腹,他们以自己的羞辱为荣耀,专以地上的事为念". 谨记!

  4. Win10搭建Linux开发环境之网络连接设定

    一直想在家自己搭建一个LINUX服务器,好在上面安装个ORACLE数据库玩玩. 上次用了Ubuntu,结果ORACLE没装成功,现在换个思路,采用CentOS 7作为Linux服务器, 之后再进行构建 ...

  5. urlencode遇到中文编码问题

    urlencode并不会改变输入的编码格式, 默认会将中文输出为 gbk 编码, 类似的, quote 会对中文进行 gbk 编码 不过, 当遇到嵌套多层的字典时, 问题就来了, 中文会被 utf8 ...

  6. October 29th Week 44th Saturday 2016

    I am a slow walker, but I never walk backwards. 我走得慢,但我从不后退. I walked very slow, sometimes I even sl ...

  7. HTTP协议请求响应过程和HTTPS工作原理

    HTTP协议 HTTP协议主要应用是在服务器和客户端之间,客户端接受超文本. 服务器按照一定规则,发送到客户端(一般是浏览器)的传送通信协议.与之类似的还有文件传送协议(file transfer p ...

  8. 【React】启动dva脚手架

    开始前: 确保node版本为6.5以上. // 安装脚手架 npm i dva-cli -g // 自动安装新工程 dva new newProjectName // 导入antd包 npm i an ...

  9. netbeans-xdebug 断点调试php

    来自NetBeans官网的帮助文档: https://netbeans.org/kb/docs/php/debugging_zh_CN.html 但具体问题,我们还是要说下 准备工作 本地部署的ser ...

  10. vmware中虚拟机与主机ping不通,桥接模式,IP地址在同一网段,无法互ping!

    现象描述:网卡选用的桥接模式,IP地址在同一个网段,虚拟机内部可以正常上网,但是Guest OS和Host OS无法互ping! 原因:虚拟机里的防火墙没有关闭,导致禁用ping功能. 解决方法:关闭 ...