Linux搭建SVN服务器 -- 简单方案 - graybull's Blog

Linux搭建SVN服务器 -- 简单方案

graybull posted @ 2013年3月07日 16:21 in App Lifecycle Manage with tags linux Server svn version control configuration management , 10284 阅读

本文将介绍Linux下搭建SVN服务器的简单解决方案,即安装基本的服务器端和客户端,提供SVN的基本服务。

而更高阶的解决方案的内容,将会包含:SVN与Apache结合提供HTTP支持,邮件配置,备份方案,使用svnstat分析SVN数据,to name a few.

  • SVN简介
  • 安装SVN服务器
  • 配置和使用SVN
  • 客户端连接SVN

SVN简介

SVN是一个代码版本管理工具,较为流行。详情请看http://subversion.apache.org/或者google之。

类似的工具有CVS,TFS和眼下热起来的Git。

安装SVN服务器

我的系统环境:rhel 6.1 x64。

查看SVN包

$ yum list | grep subversion

安装SVN包

$ sudo yum install subversion.x86_64

验证版本

$ svnserve --version
svnserve, version 1.6.11 (r934486)
   compiled Jun 23 2012, 00:44:03

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 /disk/svn

创建版本仓库,名字为firstsvn

$ svnadmin create /disk/svn/firstsvn

2) 配置SVN

版本仓库创建成功后,会在/disk/svn/firstsvn/conf目录下生成三个配置文件:

authz       #权限配置

passwd    # 用户和口令配置

svnserve.conf # SVN服务配置

  • 配置passwd

首先在passwd文件中添加了用户名jackie和口令jackiepwd。

[users]
jackie = jackiepwd

  • 配置authz

可使用分组管理的方式进行权限配置。这里的admin,devteam,testteam组都只包含了一个成员jackie而已,可添加更多成员。
[groups]
admin = jackie
devteam = jackie
docs = jackie
testteam = jackie

[firstsvn:/]
@admin = rw
* = r

[firstsvn:/dev]
@devteam = rw

[firstsvn:/test]
@testteam = rw

  • 配置svnserve.conf

主要有四个配置项,注意保证这些配置行前没有空格。                   
anon-access = none                                                   #非认证用户访问版本库的权限  
auth-access = write                                            #认证用户访问版本库的权限
password-db = /disk/svn/firstsvn/conf/passwd  #指定用户口令配置文件名
authz-db = /disk/svn/firstsvn/conf/authz            #指定权限配置文件名

3) 启动SVN服务

启动服务

$ svnserve -d -r /disk/svn

       -d表示后台运行

       -r 指定根目录是 /disk/svn

 

查看后台进程

$ ps -ef | grep svn

root      2983     1  0 09:19 ?        00:00:00 svnserve -d -r /disk/svn
jackie    4570  2496  0 10:51 pts/1    00:00:00 grep svn

客户端连接SVN

在windows下比较好用的客户端是 TortoiseSVN ,下载地址:http://tortoisesvn.net/downloads.html

安装TortoiseSVN 在Windows下新建一个文件夹svn,右键点击文件夹,选择SVN Checkout:

连接服务器。添加了新文件后,可以用Add和Commit提交到服务器。

 

 

Avatar_small
www.Gmail.com 说:
2020年2月11日 23:54

Even when you are quite good at using internet or email, you may have problems with it. Some problems are quite common and you can solve it (forgot password, forgot username...) but sometimes, because of the high secure policy of Google, proxy problems... you may cannot sign in your email. If you cannot solve it yourself, www.Gmail.com will be a helpful choice.

Avatar_small
seo service london 说:
2024年2月22日 00:35

So it is interesting and very good written and see what they think about other peopl


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter
Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee