SVN Startup Mode


First, perform the relevant configuration of the SVN repository on the server side.

Manually create a repository directory

mkdir /opt/svn

Use the svn command to create a repository

svnadmin create /opt/svn/example

Use the command svnserve to start the service

svnserve -d -r 目录 --listen-port 端口号
  • -r:The configuration method determines the repository access method.

  • --listen-port:Specify the SVN listening port. Without this parameter, SVN listens on port 3690 by default.

  • Due to different -r configuration methods, SVN startup can have two different access methods.

    Method 1: -r directly specifies the repository (called single-repository svnserve mode)

    svnserve -d -r /opt/svn/example

    In this case, one svnserve can only work for one repository.

    The repository permission configuration in the authz configuration file should be written like this:

    [groups]
    admin=user1
    dev=user2
    [/]
    @admin=rw
    user2=r
    

    Use a URL like this: svn://192.168.0.1/ to access the example repository.

    Method 2: Specify the parent directory of the repository (called multi-repository svnserve mode)

    svnserve -d -r /opt/svn

    In this case, one svnserve can work for multiple repositories.

    The repository permission configuration in the authz configuration file should be written like this:

    [groups]
    admin=user1
    dev=user2
    [example:/]
    @admin=rw
    user2=r
    
    [example01:/]
    @admin=rw
    user2=r
    

    If you still use [/] at this time, it represents the root directory of all repositories. Similarly, [/src] represents the src directory under the root directory of all repositories.

    Use a URL like this: svn://192.168.0.1/example to access the example repository.

    Other Extensions