Linux 搭建SVN服务器安装

作者:Liaodeity - 2015年03月04日

SVN 服务器搭建


2.1 使用yum 安装SVN包


关于YUM 服务器的配置参考:

Linux 搭建 YUM 服务器

自行下载

[root@singledb ~]# yum install -y subversion


Loaded plugins: rhnplugin, security

This system is not registered with RHN.

RHN support will be disabled.

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package subversion.i386 0:1.4.2-4.el5_3.1 set to be updated

--> Finished Dependency Resolution


Dependencies Resolved


====================================================================================================

Package                Arch             Version                        Repository             Size

====================================================================================================

Installing:

subversion             i386             1.4.2-4.el5_3.1                rhel-base             2.3 M


Transaction Summary

====================================================================================================

Install      1 Package(s)        

Update       0 Package(s)        

Remove       0 Package(s)        


Total download size: 2.3 M

Downloading Packages:

subversion-1.4.2-4.el5_3.1.i386.rpm                                          | 2.3 MB     00:00   

Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

  Installing     : subversion                                                                   1/1


Installed:

  subversion.i386 0:1.4.2-4.el5_3.1                                                               


Complete!

[root@singledb ~]#


验证安装版本:

[root@singledb ~]# svnserve --version


svnserve, version 1.4.2 (r22196)

   compiled Aug  5 2009, 19:03:56


Copyright (C) 2000-2006 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.



2.2 创建SVN 版本库

[root@singledb ~]# mkdir /u02/svn
[root@singledb ~]# svnadmin create /u02/svn/davesvn  --davesvn为版本库名称




2.3  SVN 配置


创建版本库后,在这个目录下会生成3个配置文件:

[root@singledb conf]# pwd
/u02/svn/davesvn/conf
[root@singledb conf]# ls
authz  passwd  svnserve.conf



(1)svnserve.conf:  svn服务配置文件下。

(2)passwd: 用户名口令文件。

(3)authz: 权限配置文件。


svnserve.conf 文件, 该文件配置项分为以下5项:

       anon-access: 控制非鉴权用户访问版本库的权限。

       auth-access:  控制鉴权用户访问版本库的权限。

       password-db: 指定用户名口令文件名。

       authz-db:指定权限配置文件名,通过该文件可以实现以路径为基础的访问控制。

       realm:指定版本库的认证域,即在登录时提示的认证域名称。若两个版本库的认证域相同,建议使用相同的用户名口令数据文件

     将 password-db 和authz-db两条的前面注释去掉.


Passwd 文件 :

       我们在svnserve.conf文件里启用这个文件。然后配置如下:

[root@singledb conf]# cat 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.

# harry = harryssecret

# sally = sallyssecret

deity = 888888


#格式说明,账号=密码


authz  文件 :
[groups]
#组=用户名
admin = deity,user
#dave新建的版本库名称
[davesvn:/]
@admin = rw


2.4 启动和停止SVN服务

(1)启动SVN服务:

[root@singledb conf]# svnserve -d -r /u02/svn


       -d表示后台运行

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

[root@singledb conf]# ps -ef | grep svn


root      4592     1  0 18:04 ?        00:00:00 svnserve -d -r /u02/svn

root      4594  3709  0 18:04 pts/1    00:00:00 grep svn

(2)停止SVN服务:

ps -aux |grep svn
kill -9 进程杀掉



本文作者: Liaodeity

本文链接: https://www.jianbaizhan.com/article/57

版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 许可协议。转载请注明出处!


 请勿发布不友善或者负能量的内容。审查将对发布广告等违规信息进行处罚!