linux下搭建svn服务器

    xiaoxiao2021-03-26  21

    1、安装svn。

    # yum install -y subversion

    Loaded plugins: fastestmirror

    Setting up Install Process

    Determining fastest mirrors

     *base: mirrors.neusoft.edu.cn

     *extras: ftp.sjtu.edu.cn

     *updates: ftp.sjtu.edu.cn

    base                                                                              | 3.7 kB     00:00    

    extras                                                                            | 3.4 kB     00:00    

    updates                                                                            | 3.4kB     00:00    

    updates/primary_db                                                                | 4.3 MB     00:03    

    Resolving Dependencies

    --> Running transaction check

    ---> Package subversion.x86_64 0:1.6.11-15.el6_7will be installed

    --> Processing Dependency: perl(URI)>= 1.17 for package: subversion-1.6.11-15.el6_7.x86_64

    --> Processing Dependency:libneon.so.27()(64bit) for package: subversion-1.6.11-15.el6_7.x86_64

    --> Running transaction check

    ---> Package neon.x86_640:0.29.3-3.el6_4 will be installed

    --> Processing Dependency:libproxy.so.0()(64bit) for package: neon-0.29.3-3.el6_4.x86_64

    --> Processing Dependency:libpakchois.so.0()(64bit) for package: neon-0.29.3-3.el6_4.x86_64

    ---> Package perl-URI.noarch0:1.40-2.el6 will be installed

    --> Running transaction check

    ---> Package libproxy.x86_640:0.3.0-10.el6 will be installed

    --> Processing Dependency:libproxy-python = 0.3.0-10.el6 for package: libproxy-0.3.0-10.el6.x86_64

    --> Processing Dependency: libproxy-bin= 0.3.0-10.el6 for package: libproxy-0.3.0-10.el6.x86_64

    ---> Package pakchois.x86_640:0.4-3.2.el6 will be installed

    --> Running transaction check

    ---> Package libproxy-bin.x86_640:0.3.0-10.el6 will be installed

    ---> Package libproxy-python.x86_640:0.3.0-10.el6 will be installed

    --> Finished Dependency Resolution

     

    Dependencies Resolved

     

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

     Package                      Arch                Version                         Repository         Size

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

    Installing:

     subversion                   x86_64              1.6.11-15.el6_7                 base              2.3 M

    Installing for dependencies:

     libproxy                     x86_64              0.3.0-10.el6                    base               39 k

     libproxy-bin                 x86_64              0.3.0-10.el6                    base              9.0 k

     libproxy-python              x86_64              0.3.0-10.el6                    base              9.1 k

     neon                         x86_64              0.29.3-3.el6_4                  base              119 k

     pakchois                     x86_64              0.4-3.2.el6                     base               21 k

     perl-URI                     noarch              1.40-2.el6                      base              117 k

     

    Transaction Summary

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

    Install       7 Package(s)

     

    Total download size: 2.6 M

    Installed size: 12 M

    Downloading Packages:

    (1/7):libproxy-0.3.0-10.el6.x86_64.rpm                                            |  39 kB    00:00    

    (2/7):libproxy-bin-0.3.0-10.el6.x86_64.rpm                                        | 9.0kB     00:00    

    (3/7):libproxy-python-0.3.0-10.el6.x86_64.rpm                                     | 9.1kB     00:00    

    (4/7): neon-0.29.3-3.el6_4.x86_64.rpm                                              |119 kB     00:00    

    (5/7): pakchois-0.4-3.2.el6.x86_64.rpm                                            |  21 kB     00:00    

    (6/7): perl-URI-1.40-2.el6.noarch.rpm                                              |117 kB     00:00    

    (7/7):subversion-1.6.11-15.el6_7.x86_64.rpm                                       | 2.3MB     00:01    

    ----------------------------------------------------------------------------------------------------------

    Total                                                                    951 kB/s | 2.6 MB     00:02    

    Running rpm_check_debug

    Running Transaction Test

    Transaction Test Succeeded

    Running Transaction

     Installing : libproxy-bin-0.3.0-10.el6.x86_64                                                      1/7

     Installing : libproxy-python-0.3.0-10.el6.x86_64                                                    2/7

     Installing : libproxy-0.3.0-10.el6.x86_64                                                          3/7

     Installing : perl-URI-1.40-2.el6.noarch                                                            4/7

     Installing : pakchois-0.4-3.2.el6.x86_64                                                           5/7

     Installing : neon-0.29.3-3.el6_4.x86_64                                                            6/7

     Installing : subversion-1.6.11-15.el6_7.x86_64                                                      7/7

     Verifying  :libproxy-0.3.0-10.el6.x86_64                                                          1/7

     Verifying  :libproxy-bin-0.3.0-10.el6.x86_64                                                      2/7

     Verifying  :pakchois-0.4-3.2.el6.x86_64                                                           3/7

     Verifying  :libproxy-python-0.3.0-10.el6.x86_64                                                   4/7

     Verifying  :neon-0.29.3-3.el6_4.x86_64                                                             5/7

     Verifying  :perl-URI-1.40-2.el6.noarch                                                            6/7

     Verifying  :subversion-1.6.11-15.el6_7.x86_64                                                      7/7

     

    Installed:

     subversion.x86_64 0:1.6.11-15.el6_7                                                                    

     

    Dependency Installed:

     libproxy.x86_64 0:0.3.0-10.el6 libproxy-bin.x86_64 0:0.3.0-10.el6libproxy-python.x86_64 0:0.3.0-10.el6

     neon.x86_64 0:0.29.3-3.el6_4  pakchois.x86_64 0:0.4-3.2.el6     perl-URI.noarch 0:1.40-2.el6        

     

    Complete!

     

    2、验证安装版本

    # 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, seehttp://subversion.tigris.org/

    This product includes software developed byCollabNet (http://www.Collab.Net/).

     

    The following repository back-end (FS)modules are available:

     

    * fs_base : Module for working with a BerkeleyDB repository.

    * fs_fs : Module for working with a plainfile (FSFS) repository.

     

    Cyrus SASL authentication is available.

     

    3、 创建svn版本库

    # mkdir -p /u02/svn

    # svnadmin create /u02/svn/davesvn

     

    4、 查看目录情况

    [root@namenode01 yl]# cd /u02/svn/davesvn/

    [root@namenode01 davesvn]# pwd

    [root@namenode01 davesvn]# ll

    total 24

    drwxr-xr-x 2 root root 4096 Feb  5 11:13 conf

    drwxr-sr-x 6 root root 4096 Feb  5 11:13 db

    -r--r--r-- 1 root root    2 Feb 5 11:13 format

    drwxr-xr-x 2 root root 4096 Feb  5 11:13 hooks

    drwxr-xr-x 2 root root 4096 Feb  5 11:13 locks

    -rw-r--r-- 1 root root  229 Feb 5 11:13 README.txt

     

    [root@namenode01 davesvn]# cd conf/

    [root@namenode01 conf]# ll

    total 12

    -rw-r--r-- 1 root root 1080 Feb  5 11:13 authz 权限配置文件

    -rw-r--r-- 1 root root  309 Feb 5 11:13 passwd  用户名口令文件

    -rw-r--r-- 1 root root 2279 Feb  5 11:13 svnserve.conf  svn服务配置文件

     

    5、开始配置,就是配置authz、passwsvnserve.conf

    5.1、配置用户名密码口令

    [root@namenode01 conf]# cat passwd

     

    [users]

    # harry = harryssecret

    # sally = sallyssecret

    zhangs= zhangs

    wangw = wangw

     

    5.2、配置权限(对应的用户、组 对应目录是否可读可写)

    [root@namenode01 conf]# cat authz

     

    [aliases]

    # joe = /C=XZ/ST=Dessert/L=SnakeCity/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

     

    [groups]

    # harry_and_sally = harry,sally

    # harry_sally_and_joe =harry,sally,&joe

    admin = zhangs

    dev = wangw

     

    # [/foo/bar]

    # harry = rw

    # &joe = r

    # * =

     

    # [repository:/baz/fuz]

    # @harry_and_sally = rw

     

    [davesvn:/] //对应这个目录是

    @admin=rw

    @dev=r

    也可以配置如下

    [/]  //对应这个目录是

    zhangs=rw

    wangw=r

     

     

    5.3、配置svnserve.conf

    [root@namenode01 conf]# cat svnserve.conf

     

    [general]

    anon-access = none //用户访问时要求登录验证

    auth-access = write //默认如果权限中不设置,那么就可读可写

    password-db = passwd //指定用户配置文件,如果不指定,那么用户配置中内容部不起作用!

    authz-db = authz //指定权限配置文件,如果不指定,那么权限配置中的内容不会起作用!

    realm = My First Repository

     

    [sasl]

     

    6、启动svn服务器及关闭服务器

    # svnserve -d -r /u02/svn/

    说明:-d说明是后台启动

        -r指定对应的目录

     

    # ps -ef|grep svn

    # kill pid

    备注:最好服务器启动的时候自动启动。

    这样就已经搭建好了。需要客户端进行操作。 地址svn://192.168.1.19/davesvn

    卸载:

    [root@namenode01 conf]# rpm -qa subversion subversion-1.6.11-15.el6_7.x86_64 [root@namenode01 conf]# rpm -e --nodeps subversion

    转载请注明原文地址: https://ju.6miu.com/read-660586.html

    最新回复(0)