本文以ubuntu系统进行安装。

1、安装svn服务器

apt-get install subversion 

输入 y 回车确认安装。

安装完毕后可以用 下边的命令查看是否安装完成,如果现实出版本号和版权信息等等就证明安装完成。

svn --version
svn --version 成功后展示如下信息
svn, version 1.8.8 (r1568071)
compiled Aug 20 2015, 12:51:30 on x86_64-pc-linux-gnu Copyright (C) 2013 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 access (RA) modules are available: * ra_svn : Module for accessing a repository using the svn network protocol.
- with Cyrus SASL authentication
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
- using serf 1.3.3
- handles 'http' scheme
- handles 'https' scheme

2、创建版本库

  首先创建目录,根据你的需要创建svn目录。我目录是:/usr/svn/test

  然后创建版本仓库:

  

svnadmin create /usr/svn/test

3、配置svn服务器

  创建版本仓库后再 test/conf文件夹下生成了四个配置文件:authz  hooks-env.tmpl  passwd  svnserve.conf
  ①、首先 svnserve.conf里边配置了版本库的权限,需要把下边5行的注释打开,一定注意,去掉#号的同时把空格去掉,否则svn服务不能正常运行
    

anon-access = none
#控制非鉴权用户访问版本库的权限。取值范围为"write"、"read"和"none"。即"write"为可读可写,"read"为只读,"none"表示无访问权限。缺省值:read
auth-access = write
#控制鉴权用户访问版本库的权限。取值范围为"write"、"read"和"none"。即"write"为可读可写,"read"为只读,"none"表示无访问权限。缺省值:write
password-db = passwd
#指定账户密码配置文件,当前文件夹下的passwd文件
authz-db = authz
#权限配置文件,当前文件夹下的authz文件
realm = first
#版本库的认证域,即在登录时提示的认证域名称。若两个版本库的 认证域相同,建议使用相同的用户名口令数据文件。缺省值:一个UUID(Universal Unique IDentifier,全局唯一标示)

  ②、配置passwd

    如下代码,配置了用户名为test的用户,并为其创建了密码test123.如需要配置多用户就多写几个吧,记得换行

### 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=test123

  ③配置authz权限

  下边的代码为test用户创建了读和写的权限。

[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

  如果用户较多,需要分角色划分权限参考下边代码

    这段代码,为test创建了admin的角色,为ttt用户创建了user的角色,最后使用@符号为角色创建权限,admin角色读写权限,user角色读权限。

[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe # [/foo/bar]
# harry = rw
# &joe = r
# * =
admin=test
user=ttt
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
[/]
@admin=rw
@user=r

ok,配置已经完成,让我们启动svn服务器试试吧

  执行命令:

svnserve -d -r /usr/svn

启动服务器,-d表示守护线程后台运行,-r表示指定目录。注意:不要写成svnserve -d -r /usr/svn/test。否则虽然服务可正常启动,但是客户端用的时候可能会产生问题

查看是否启动成功:

ps -ef | grep svnserve

如果结果为两个线程在运行,一般是成功了。

4、客户端访问

  下载客户端不在赘述。

  svn地址:svn://ip/test  然后输入用户名test和密码test123确认。

  是不是连上了呢?如果没有检查是否清除了旧的数据信息,

  清除旧数据方法:右键->tortoisesvn->setting->Saved Data,都clear掉吧。

最后补充关闭svn服务器的方法:使用ps -ef | grep svnserve查看进程后,记住pid,然后  kill -9 pid  就可以关闭了。

linux 配置svn服务器+使用+注意事项的更多相关文章

  1. Linux配置svn服务器版本库

    1)创建版本库首先使用yum安装subversion 2)创建版本库 svnadmin create /home/svn/svnfile 3)进入conf目录 authz               ...

  2. Linux下SVN服务器搭建配置

    Linux下SVN服务器搭建配置 1.SVN服务安装 yum install subversion 2.创建SVN代码仓库 mkdir /data/svn svnadmin create /data/ ...

  3. linux下安装配置svn服务器

    linux下安装配置svn服务器 1. svn服务器安装 将subversion-1.4.0.tar.gz和subversion-deps-1.4.0.tar.gz传到服务器. tar xfvz su ...

  4. Linux下svn服务器的安装与配置-备份-恢复-计划任务

    简介:SVN是Subversion的简称,是一个开放源代码的版本控制系统,相较于RCS.CVS,它采用了分支管理系统,它的设计目标就是取代CVS.互联网上很多版本控制服务已从CVS迁移到Subvers ...

  5. 原 Linux搭建SVN 服务器2

    原 Linux搭建SVN 服务器 发表于1年前(2014-08-05 17:55)   阅读(12257) | 评论(3) 31人收藏此文章, 我要收藏 赞3 摘要 Linux搭建SVN 服务器 目录 ...

  6. 原 Linux搭建SVN 服务器

    原 Linux搭建SVN 服务器 发表于1年前(2014-08-05 17:55)   阅读(12257) | 评论(3) 31人收藏此文章, 我要收藏 赞3 摘要 Linux搭建SVN 服务器 目录 ...

  7. Linux搭建SVN 服务器

    Linux搭建SVN 服务器 1          安装SVN 2          使用客户端连接 2.1       使用windows的客户端 2.2       使用Linux下的命令行 3  ...

  8. Linux搭建SVN 服务器(转)

    转自:http://my.oschina.net/lionel45/blog/298305 Linux搭建SVN 服务器 作者: 沈小然    日期:2014年 8月 5日 1          安装 ...

  9. Linux搭建SVN服务器(服务端)

    Linux搭建SVN服务器(服务端) 1 安装SVN SVN客户端:TortoiseSVN,官网下载:https://tortoisesvn.net/downloads.html(客户端) # yum ...

随机推荐

  1. C++11新特性实验

    #include <iostream> #include <vector> #include <map> #include <string> #incl ...

  2. iconv 解决乱码问题

    [root@NGINX-APACHE-SVN pro]# file 林.txt 林.txt: ISO-8859 text, with no line terminators #在LINUX下显示乱码 ...

  3. db2 连接报错connect。 ERRORCODE=-4499, SQLSTATE=08001(转载)

    在使用data studio连接远程DB2数据库时报错如下: [jcc][Thread:main][SQLException@5b775b77] java.sql.SQLException [jcc] ...

  4. EF调用存储过程、函数

    一.ef4.1 codeFirst 修改表结构 增加字段等 EF code first需要重新生成库导致数据丢失的问题 说这个问题前 首先先说下 我使用ef4.1 codefirst的目的. 是因为可 ...

  5. php 模板框架之smarty 的下载和安装

    Smarty 官网: http://www.smarty.net/ Smarty 下载: https://github.com/smarty-php/smarty/releases/tag/v3.1. ...

  6. modSecurity和Naxsi哪个更适合Nginx搭建WAF

    nginx增加modsecurity模块 modsecurity原本是Apache上的一款开源waf,可以有效的增强web安全性,目前已经支持nginx和IIS,配合nginx的灵活和高效,可以打造成 ...

  7. 删除Cookies

    网上一堆删除Cookies的JS代码 但是都删不了,找了好久终于在MSDN的论坛找到一个方法 function ClearCookie(name) { ****; var expDate = new ...

  8. sql row_number 用法

    自己研究了一下RowNum ,发现这样的分页挺清晰的 --第几页,一页多少行declare @PageIndex int,@PageMax intset @PageIndex =1set @PageM ...

  9. PCB封装技术

    TQFP(thin quad flat package,即薄塑封四角扁平封装)薄四方扁平封装低成本,低高度引线框封装方案. MLF(MicroLeadFrame),MLF接近于芯片级封装(Chip S ...

  10. 【mysql】windows7 安装 Mysql

    From: http://jingyan.baidu.com/article/e52e3615a1128c40c70c5174.html 安装(解压) ZIP Archive版是免安装的.只要解压就行 ...