SVN服务安装

  1.  安装SVN

    [root@test2 opt]# yum install subversion
  2. 查看安装版本

    [root@test2 opt]# svn --version
    svn, version 1.7.14 (r1542130)
       compiled Apr 11 2018, 02:40:28
    
    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_neon : Module for accessing a repository via WebDAV protocol using Neon.
      - handles 'http' scheme
      - handles 'https' scheme
    * 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
  3. 创建项目目录

    [root@test2 opt]# mkdir  /usr/local/svn
    [root@test2 opt]# mkdir  /usr/local/svn/fas
  4. 创建项目仓库

    [root@test2 opt]# svnadmin create /usr/local/svn/fas
    [root@test2 opt]# cd /usr/local/svn/fas
    [root@test2 fas]# ls
    conf  db  format  hooks  locks  README.txt
    

      

  5. 配置用户

    [root@test2 fas]# cd conf/
    [root@test2 conf]# ls
    authz  passwd  svnserve.conf
    [root@test2 conf]# vi passwd
    [root@test2 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.
    
    [users]
    # harry = harryssecret
    # sally = sallyssecret
    
    admin = 123456 user1 = 123456 user2 = 123456

      

  6. 权限设置

    [root@test2 conf]#  vi authz
    [root@test2 conf]# cat authz
    ### This file is an example authorization file for svnserve.
    ### Its format is identical to that of mod_authz_svn authorization
    ### files.
    ### As shown below each section defines authorizations for the path and
    ### (optional) repository specified by the section name.
    ### The authorizations follow. An authorization line can refer to:
    ###  - a single user,
    ###  - a group of users defined in a special [groups] section,
    ###  - an alias defined in a special [aliases] section,
    ###  - all authenticated users, using the '$authenticated' token,
    ###  - only anonymous users, using the '$anonymous' token,
    ###  - anyone, using the '*' wildcard.
    ###
    ### A match can be inverted by prefixing the rule with '~'. Rules can
    ### grant read ('r') access, read-write ('rw') access, or no access
    ### ('').
    
    [aliases]
    # joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
    
    [groups]
    # harry_and_sally = harry,sally
    # harry_sally_and_joe = harry,sally,&joe
    
    fas = user1,user2
    
    # [/foo/bar]
    # harry = rw
    # &joe = r
    # * =
    
    # [repository:/baz/fuz]
    # @harry_and_sally = rw
    # * = r
    
    [/]
    admin = rw
    
    [fas:/]
    @fas = rw
    

      

  7. 修改svnserve.conf

    [root@test2 conf]# grep -v "#" svnserve.conf
    
    
    [general]
    anon-access = none
    auth-access = write
    password-db = passwd
    authz-db = authz
    realm = /usr/local/svn
    
    [sasl]
  8. 启动服务

    [root@test2 conf]# svnserve -d -r /usr/local/svn
    [root@test2 conf]# ps -ef|grep svn
    root      13542      1  0 11:19 ?        00:00:00 svnserve -d -r /usr/local/svn
    root      13557   8765  0 11:19 pts/1    00:00:00 grep --color=auto svn

     

posted @ 2022-06-23 11:23  圣光救赎者  阅读(28)  评论(0编辑  收藏  举报