Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install SVN Server in linux system

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to install SVN server in linux system". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to install SVN server in linux system.

First, install SVN

Download from the official website: http://subversion.apache.org/packages.html

SVN client: TortoiseSVN, official website download: http://tortoisesvn.net/downloads.html

# yum install subversion

1. Create a new directory to store all SVN files

# mkdir / svn

1) to create svn user # groupadd svn # useradd-g sky user// is to add user to the sky group to switch user # su svn after the creation and maintenance of the code base, etc., all use this account to operate.

2) verify the installation

Verify the installed SVN version information [root@localhost modules] # svnserve--version

Svnserve, version 1.6.11 (r934486) compiled on Jun 23 2012

Copyright (C) 2000-2009 CollabNet. Subversion is open source software, see the http://subversion.tigris.org/ site. This product contains software developed by CollabNet (http://www.Collab.Net/)).

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

* fs_base: the module can only operate on the BDB version library. * fs_fs: modules work with text file (FSFS) version libraries.

Cyrus SASL certification is available.

two。 Create a new resource warehouse

# svnadmin create / svn/project

# ls / svn/project/

Conf db format hooks locks README.txt

Description of the purpose of the catalogue:

L hooks directory: the directory where the hook script files are placed

L locks directory: the directory where subversion's db lock files and db_logs lock files are placed, and used to track clients accessing the vault.

L format file: a text file with only an integer indicating the version number of the current vault configuration

L conf directory: is the configuration file for this warehouse (the user's access account, permissions, etc.)

3. Configure the configuration file for the svn service svnserver.conf file

# vi / svn/project/conf/svnserve.conf

[general]

Anon-access = none

Auth-access = write

Password-db = / svn/project/conf/passwd

Authz-db = / svn/project/conf/authz

Realm = My Test Repository # this is a prompt

Save

[[general

# Anonymous access, which can be read,write,none. Default is readanon-access=none#, which allows authorized users to write to the path of auth-access=write# password database. Password-db=passwd# access control file authz-db=authz# authentication namespace, subversion will be displayed in the authentication prompt and cached as a keyword for credentials

Realm=/opt/svn/repositories]

All the above statements must be written at the top, and no spaces can be left on the left, otherwise there will be errors.

4. Add two access users and password

# vi / svn/project/conf/passwd

[users]

Xiaoran.shen = 123456

Test1 = 123456

Test2 = 123456

Save

Note: changes to the user profile take effect immediately, and there is no need to restart the svn service.

5. Configure authorization files for new users

# vi / svn/project/conf/authz

[groups]

Admin = xiaoran.shen,test1

User = test2

[/]

(# setting [/] represents all resources in the root directory [/] or written as [repl:/])

@ admin

= rw

@ user

= r

* =

Save

Format description:

Version library directory format:

[: / Project / Directory]

@ =

=

/ means to set permissions on all subdirectory scope under the root directory (that is, / svn/project directory)

[/ abc] means to set permissions on the abc project in the database

Create an admin group whose members include xiaoran.shen and test1

Create a user group with only test2 members

Admin group has read and write access to the directory

Individual user test2 has read and write permissions

* = indicates that all users except the permission group set above set null permissions, which means that access to this directory is prohibited, which is important to add.

Note: changes to the permission profile take effect immediately, and there is no need to restart svn.

6. Start the svn service

Svnserve-d-r / svn/project/

Note: do not use the / etc/init.d/svnserve start provided by the system to start, because the system default startup script does not specify a resource with the-r / svn/project parameter. For the svn service started in this case, the client connection will prompt an error such as "svn: No repository found in 'svn://192.168.11.229/project'".

The default svn server port is 3690.

Kill the svn service:

# ps-ef | grep svn

Root 4642 1 016 r/svn/project/ 08? 00:00:00 svnserve-d-r/svn/project/

Root 4692 3676 0 16:17pxs/2 00:00:00 grep svn

# kill-9 4642

To use the / etc/init.d/svnserve script, you can modify the start () function section as follows:

Start () {

[- x $exec] | | exit 5

[- f $config] | | exit 6

Echo-n $"Starting $prog:"

Daemon-- pidfile=$ {pidfile} $exec $args-r / svn/project

Retval=$?

Echo

[$retval-eq 0] & & touch $lockfile

Return $retval

}

Complete

Second, use client connection

2.1 clients using windows

Open the TortoiseSVN Repository Browser tool

In URL, enter:

Enter svn://192.168.11.229 and prompt for a user name and password

2.2 use the command line under Linux

#

Svn co svn://192.168.11.229

3 FAQ

3.1 Command line connection, prompting svn: No repository found in 'svn://192.168.11.229/project' error?

Solution: the-r / svn/project parameter is not used when starting the svn service, and the specific path to the repository is not specified. Just start it with the # svnserve-d-r / svn/project/ command, not the / etc/init.d/svnserver script.

3.2 prompt "svn:Authorization failed" error when executing the command # svn co svn://192.168.11.229/project?

Solution: generally speaking, the error cause of this authorization failure comes from the configuration of the conf/authz file.

The correct configuration is as follows:

[groups]

Admin = xiaoran.shen,test1

User = test2

[/]

@ admin

= rw

@ user

= rw

* =

Save

If authentication fails when connecting, check the authz and svnserve.conf configuration files.

[if the switch is connected, check the fire protection setting # vi / etc/sysconfig/iptables to join:-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 3690-j ACCEPT#service iptables restart

Create a script to start Subversion: # echo 'svnserve-d-r start_svn.sh#./start_svn.sh optUnip _ start_svn.sh#./start_svn.sh _ htdocs _ _ start_svn.sh#./start_svn.sh

Place the startup script in the boot auto startup script: modify the file as root: / etc/rc.d/rc.local, add the following text: su-c / opt/lampp/htdocs/_svn/start_svn.sh svn]

Thank you for your reading, the above is the content of "how to install SVN server in linux system". After the study of this article, I believe you have a deeper understanding of how to install SVN server in linux system. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report