Linux SVN服务器搭建

1. Ubuntu PC一台,最好是最新的Ubuntu稳定版本

2. 执行以下命令安装subversion:

sudo apt-get update
sudo apt-get install subversion

3. 假设代码svn仓库的根路径定为 /home/svnroot,执行以下命令新建目录:

sudo mkdir /home/svnroot

4. 新建一个代码仓库,假设仓库名为:example

cd /home/svnroot
sudo svnadmin create example

此命令执行完成后会在 /home/svnroot 下多出来一个名为example的目录,这就是example代码仓库了。

5. 编辑example仓库的访问权限

即:修改 /home/svnroot/example/conf下的三个文件:authz passwd svnserve.conf

其中:

passwd 中保存了用户名和密码

authz 中保存了用户组定义及各目录的访问权限定义

svnserve.conf 中保存了本代码仓库使用的配置(是否允许匿名用户?指定用户名和密码数据库...)

这里给出一个典型的配置:

passwd实例:

[users]
xiaoming = 1111
xiaowang = 2222
xiaoli = 3333
laowang = 4444
shuangshuang = 5555
dashi = 6666

authz实例(admin可以读写所有目录,dev能读写branch,dev只读trunk/tag):

[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
[groups]
admin = xiaoli
dev = laowang,shuangshuang,dashi,xiaowang,xiaoming
[/]
@admin = rw
@dev = r
[/trunk]
@admin = rw
@dev = r
[/tag]
@admin = rw
@dev = r
[/branch]
@admin = rw
@dev = rw

svnserve.conf实例(关闭匿名访问,指定用户数据库和鉴权数据库):

### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository. (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)
### Visit http://subversion.tigris.org/ for more information.
[general]
### These options control access to the repository for unauthenticated
### and authenticated users. Valid values are "write", "read",
### and "none". The sample settings below are the defaults.
anon-access = none
auth-access = write
### The password-db option controls the location of the password
### database file. Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control. Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file. If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa. The default realm
### is repository's uuid.
# realm = My First Repository
[sasl]
### This option specifies whether you want to use the Cyrus SASL
### library for authentication. Default is false.
### This section will be ignored if svnserve is not built with Cyrus
### SASL support; to check, run 'svnserve --version' and look for a line
### reading 'Cyrus SASL authentication is available.'
# use-sasl = true
### These options specify the desired strength of the security layer
### that you want SASL to provide. 0 means no encryption, 1 means
### integrity-checking only, values larger than 1 are correlated
### to the effective key length for encryption (e.g. 128 means 128-bit
### encryption). The values below are the defaults.
# min-encryption = 0
# max-encryption = 256

6. 添加svn服务为系统自启动项目

- 创建svnd.sh ,内容如下

#!/bin/bash
svnserve -d -r /home/svnroot

将这个文件放在 /etc/init.d/svnd.sh

这个脚本的功能:启动svn服务,只有在启动服务后,外部的机器才能通过各种svn工具来访问svn服务器。

- 添加可执行权限

sudo chmod a+x /etc/init.d/svnd.sh

- 编辑 rc.local

vim /etc/rc.local

在exit 0之前,加上
/etc/init.d/svnd.sh

- 重启服务器,然后执行命令:

ps -e | grep svnserve

从命令结果来检查svn服务是否已经自动的随系统启动。

时间: 2024-08-11 05:44:45

Linux SVN服务器搭建的相关文章

linux svn服务器搭建、客户端操作、备份与恢复

Subversion(SVN)是一个开源的版本控制系統,管理着随时间改变的数据.这些数据放置在一个中央资料档案库中,这个档案库很像一个普通的文件服务器,它会记住每一次文件的变动,这样就可以把档案恢复到旧的版本,或是浏览文件的变动历史. 本文目录: linux svn服务器部署 linux svn客户端命令操作 linux svn备份与恢复 一.linux svn服务器部署 1.安装svn [[email protected]~]#yum install -y subversion [[email

Linux: SVN服务器搭建(一)

摘自http://www.cnblogs.com/xiaobaihome/archive/2012/03/20/2407610.html Subversion是优秀的版本控制工具,其具体的的优点和详细介绍,这里就不再多说. 首先来下载和搭建SVN服务器. 现在Subversion已经迁移到apache网站上了,下载地址: http://subversion.apache.org/packages.html 这是二进制文件包的下载地址,你可在左侧的导航栏找到源代码,文档的下载地址. windows

Linux下的SVN服务器搭建

鉴于在搭建时,参考网上很多资料,网上资料在有用的同时,也坑了很多人 本文的目的,也就是想让后继之人在搭建svn服务器时不再犯错,不再被网上漫天的坑爹作品所坑害,故此总结 /******开始*********/ 系统环境:Centos 6.5 第一步:通过yum命令安装svnserve,命令如下: >yum -y install  subversion 此命令会全自动安装svn服务器相关服务和依赖,安装完成会自动停止命令运行 若需查看svn安装位置,可以用以下命令: >rpm -ql subve

linux svn服务器的搭建

一.修改SVN服务器的配置文件  安装 Yum install subversion 在库创建完成之后会在conf下会生成svnserve.conf, passwd, authz三个文件. 1)svnserve.conf anon-access = none auth-access = write password-db = passwd (svn密码文件,若有多个库,可将文件放到公共位置) authz-db = authz   (目录权限文件,建议同上) realm = /svn/projec

Linux CentOS 6.5 x64 SVN服务器搭建

Linux CentOS 6.5 x64 SVN服务器搭建步骤 1. 安装Subversion yum install subversion 注意:安装需要使用root权限,否则会提示You need to be root to perform this command.英文也很简单,这里就不多废话了. 2. 查看Subversion的安装位置 rpm -ql subversion 我们看到在bin目录下放有可执行的命令: 可以通过查看SVN版本来确认是否已经安装成功,输入如下命令: svn -

Linux SVN 服务器

一. SVN 简介 Subversion(SVN) 是一个开源的版本控制系統, 也就是说 Subversion 管理着随时间改变的数据. 这些数据放置在一个中央资料档案库 (repository) 中. 这个档案库很像一个普通的文件服务器, 不过它会记住每一次文件的变动. 这样你就可以把档案恢复到旧的版本, 或是浏览文件的变动历史. SVN中的一些概念 : (1). repository(源代码库) 源代码统一存放的地方 (2). Checkout (提取) 当你手上没有源代码的时候,你需要从r

Linux NTP 服务器搭建

Linux时间同步服务器搭建 NTP(Network Time Protocol)是用来使计算机时间同步化的一种协议,它使用UDP协议123号端口对外提供服务,它可以使计算机对其服务器或时钟源(如石英钟,GPS等等)做时间的同步化,它可以提供高精准度的时间校正(LAN上与标准间差小于1毫秒,WAN上几十毫秒),且可介由加密确认的方式来防止恶毒的协议攻击.时间按NTP服务器的等级传播.按照离外部UTC源的远近把所有服务器归入不同的Stratum(层)中. 今天做一个项目需要配置一台NTP时间同步服

Linux ISCSI服务器搭建

Linux ISCSI服务器搭建 1. iscsi服务器简述 iSCSI技术是一种由IBM公司研究开发的,是一个供硬件设备使用的可以在IP协议的上层运行的SCSI指令集,这种指令集合可以实现在IP网络上运行SCSI协议,使其能够在诸如高速千兆以太网上进行路由选择.iSCSI技术是一种新储存技术,该技术是将现有SCSI接口与以太网络(Ethernet)技术结合,使服务器可与使用IP网络的储存装置互相交换资料. iSCSI:Internet 小型计算机系统接口 (iSCSI:Internet Sma

SVN服务器搭建和使用

VS2015的官方VisualSVN-5.0.1 插件这里,还是遇到了一些问题,我知道有插件了,但是忽略了开始的版本问题,按时插件安装过程中没有出现意外,故以为"插件安装成功",岂不知此"成功"非彼"成功".由于我用的是VisualSVN-Server-3.5.7-x64,适应的VS版本最新的是2012版,故不适应与VS2015版本的,然后就去下载的最新版本,最终才成功安装实现VS2015和SVN的结合. 对应VS2015的官方VisualSVN