[SVN] SVN environment deployment under linux

Working in a small company, many projects are developed by myself, and there is no need for distributed and automatic release. Therefore, I am nostalgic for this version of svn tool. I just feel friendly and simple configuration.

1, What is Svn

  • brief introduction
    The full name of Svn is subversion. Is an open source version control system. Subversion stores files in a central repository. This version library is very much like an ordinary file server. The difference is that it can record every modification of files and directories. Through her, developers can easily restore the data to the previous version, and can view the modification details of the data. It can be called a "time machine".
    Subversion allows different users to modify and manage the same set of data located in the central version Library in a multi-threaded mode on their respective computers, so it can promote team collaboration. In addition, it is a general-purpose system that can manage any type of file set.
    Other common version control systems: VSS, Visual Source Save, Microsoft version controller software; CVS, Concurrent Versions System, another open source and free version control system; ClearCase, IBM.
  • svn principle
    Svn can choose a variety of protocols for the interaction between client and server data files, including SVN protocol, http or https protocol. SVN protocol is supported by default, with the help of mod_dav_svn module, together with http server such as apache, can support http and https protocols. Corresponding to these two different protocols, SVN has two different operation modes, one is an independent SVN server, the other is run with apache.
    Svn adopts C/S architecture. Users operate the version library on the SVN server through the SVN client. As shown in Figure 1 below.

svn also has two ways to store version data: BDB (a transaction safe storage mode, Berkeley DB database) and FSFS (a storage system that does not need a database). Because BDB mode may lock data when the server is interrupted, FSFS mode is safer.

  • Why use svn
    1. Provide the team with the back button of all project documents;
    2. Support multiple developers to work for the same code in a controllable way;
    3. The version control system saves all changes of the document in the past, so as to find out who, when and what modified the document;
    4. Support multiple versions on the main line of the document at the same time;
    5. It supports querying the status of each document of the project at a certain time point, which can be used to study production efficiency, etc., and can also be used to redistribute previous software releases.

2, Svn compilation and installation

  • Data preparation

[root@iZm5eejq1i5n8h97elgv2tZ svnlinux]# ls
apr-1.5.0.tar.gz  apr-util-1.5.3.tar.gz  sqlite-amalgamation-3071501.zip  subversion-1.8.5.tar.gz  

  • setup script
cd /usr/local/src
tar -zxvf subversion-1.8.5.tar.gz
unzip sqlite-amalgamation-3071501.zip
mv ./sqlite-amalgamation-3071501 ./subversion-1.8.5/sqlite-amalgamation
cd subversion-1.8.5
./configure --prefix=/usr/local/svn/   --without-berkeley-db   --with-zlib
make&&make install
###Setting environment variables
echo 'export PATH=/usr/local/svn/bin:$PATH'>>/etc/profile
source /etc/profile
#Test for successful installation:
svnserve --version
mkdir -p /data/svndata/yxyweb
#Create svn directory
svnadmin create /data/svndata/yxyweb

#
mkdir -p /data/project

#Connect svn
svn checkout svn://127.0.0.1/yxyweb /data/project
svn update /data/project

### Start svn

svnserve -d -r /data/svndata

  • Configuration description
#Modify the passwd configuration as follows
[users]
# harry = harryssecret
# sally = sallyssecret
cmm = 123456..

#Modify authz information configuration as follows

[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
admin = cmm
# [/foo/bar]
# harry = rw
# &joe = r
# * =
[/]
@admin = rw
cmm = rw
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
[svndata:/repos1]
cmm = rw

#Modify svnserve conf

anon-access = read
auth-access = write

password-db = passwd
authz-db = authz

Client connection
We install the svn client tool on the client. Generally, I use this tool [TortoiseSVN] Little Turtle https://tortoisesvn.net/downloads.html
After installation, the svncheckout option will be available by right clicking on the desktop.

Keywords: svn Operating System

Added by iHack on Mon, 03 Jan 2022 04:04:16 +0200