Introduction to Linux to build SVN server method

Source: Internet
Author: User
Tags commit svn version control system tortoisesvn collabnet

A. SVN profile
Subversion (SVN) is an open source version control system, which means that subversion manages data that changes over time. This data is placed in a central data archive (repository). The archive is like a regular file server, but it remembers the changes in each file. This allows you to revert to the old version of the file, or to browse the history of the changes.

Some of the concepts in SVN:
(1). Repository (source code base)
Where source code is stored uniformly
(2). Checkout (extract)
When you have no source code in your hand, you need to checkout a copy from Repository.
(3). Commit (Submit)
When you have modified the code, you need to commit to Repository
(4). Update (Updated)
When you have checkout a source code, update it and you can sync with the code on the repository, and you will have the latest changes in your hands.

The daily development process is actually the case (assuming you've been checkout and working for a few days): Update (get the latest code) –> make your own changes and debug the success –> Commit (you can see your changes).
If two programmers modify the same file at the same time, SVN can merge the changes between the two programmers, actually SVN management source code is in the behavior unit, that is, two programmers as long as not modify the same line program, SVN will automatically merge two changes. If the same row, SVN will prompt file confict, conflict, need to confirm manually.

Client software:
(1) commonly used TORTOISESVN for client software under Windows. It is a free and open source client. Download Address: http://tortoisesvn.net/downloads.html
(2) to MyEclipse, there are some SVN plug-ins.

Subversion provides the following main features:
(1) Catalog version control
CVS can only track the history of a single file, but Subversion is a "virtual" version control file system that can track changes to the entire directory over time. Both directories and files can be version controlled.

(2) True version history
Since CVS restricts file versioning, CVS does not support operations that can occur on files, but affect the contents of the directory, like copying and renaming. In addition, in CVS you cannot replace a file that has been incorporated into the system with a file that has the same name but does not inherit the old version or have no relationship at all. In subversion, you can add (add), delete (delete), copy (copy) and rename (rename), whether it is a file or a directory. All the newly added files start with a new, clean version.

(3) Automatic submission
A submit action, not all updated to the archive, is completely not updated. This allows developers to set up and submit changes in logical intervals to prevent problems that occur when a partial commit succeeds.

(4) Metadata included in version control
Each file and directory is accompanied by a property keyword and is associated with a property value. You can create, and gamma Ai Wei Wen langfeng guanidine?? Ey/value right. Properties are versioned over time, like files. Hot lie?? /p>

(5) Select a different network layer
Subversion has an abstract repository access concept that makes it easy for people to implement new network mechanisms. Subversion can be embedded in the Apache HTTP server as an extension module. This provides a very advanced stability and collaboration capability for subversion, and it also provides many important features: For example, authentication, authorization, online compression, and file-Library browsing, among other things. There is also a lightweight stand-alone Subversion server that uses custom communication protocols that can be easily tunnel via SSH.

(6) Consistent method of data processing
Subversion uses binary differencing to differentiate between file differences, and it treats both types of text (human-understandable) and binary files (which humans cannot understand). Both types of files are stored in the archive in the same compressed form, and file differences are transmitted over the network in two directions.

(7) Valid branches (branch) and tags (tag)
Consumption on branches and labels does not necessarily have to be proportional to the size of the item. Subversion's way of building branching and tagging is simply to replicate the project, using a method similar to a hard connection (Hard-link). So these operations only cost very little and are fixed time.

(8) Hackability
Subversion has no historical baggage; It is mainly a group of common C Program library, with a well-defined API. This makes Subversion easy to maintain and can be used by other applications and program languages.

Two. SVN Server build

2.1 Installing the SVN package using Yum

About configuration references for Yum servers:
Linux builds YUM server

Http://blog.csdn.net/tianlesoftware/archive/2011/01/03/6113902.aspx

[Root@singledb ~]# Yum install-y Subversion
Loaded Plugins:rhnplugin, security
This system is not registered with RHN.
RHN support would be disabled.
Setting up Install Process
Resolving dependencies
–> Running Transaction Check
-> Package subversion.i386 0:1.4.2-4.el5_3.1 set to be updated
–> finished Dependency resolution

Dependencies resolved

====================================================================================================
Package Arch Version Repository Size
====================================================================================================
Installing:
Subversion i386 1.4.2-4.el5_3.1 rhel-base 2.3 M

Transaction Summary
====================================================================================================
Install 1 Package (s)
Update 0 Package (s)
Remove 0 Package (s)

Total Download size:2.3 M
Downloading Packages:
subversion-1.4.2-4.el5_3.1.i386.rpm | 2.3 MB 00:00
Running Rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing:subversion 1/1

Installed:
Subversion.i386 0:1.4.2-4.el5_3.1

complete!
[Root@singledb ~]#

To verify the installed version:
[Root@singledb ~]# Svnserve–version
Svnserve, version 1.4.2 (r22196)
Compiled Aug 5 2009, 19:03:56

Copyright (C) 2000-2006 collabnet.
Subversion is open source software, http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

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

* Fs_base:module for working with a Berkeley DB repository.
* Fs_fs:module for working with a plain file (FSFS) repository.

2.2 Creating the SVN version Library
[Root@singledb ~]# MKDIR/U02/SVN
[Root@singledb ~]# svnadmin create/u02/svn/davesvn–davesvn for version library name

2.3 SVN Configuration

After you create a version library, 3 profiles are generated in this directory:
[Root@singledb conf]# pwd
/u02/svn/davesvn/conf
[Root@singledb conf]# ls
Authz passwd svnserve.conf

(1) SVNSERVE.CONF:SVN under the service configuration file.
(2) passwd: username password file.
(3) Authz: Permissions configuration file.

svnserve.conf file, the file configuration item is divided into the following 5 items:
Anon-access: Controls the right of the non-authentication user to access the version library.
Auth-access: Controls the right of authentication users to access the version library.
PASSWORD-DB: Specifies the username password file name.
AUTHZ-DB: Specifies the permission profile name through which path-based access control can be implemented.
Realm: Specifies the authentication domain for the version library, that is, the authentication domain name that is prompted at logon. It is recommended that you use the same username password data file if the authentication domain of two libraries is the same

PASSWD file:
We enable this file in the svnserve.conf file. It is then configured as follows:
[Root@singledb conf]# Cat passwd
### This file is a 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.

[Users]
# Harry = Harryssecret
# sally = Sallyssecret
Dave = Davepwd
Tianlesoftware = Tianlesoftwarepwd

Authz file:
Find a good example of configuration on the Web:
[Groups]
admin = John, Kate
DEVTEAM1 = John, Rachel, Sally
Devteam2 = Kate, Peter, Mark
Docs = Bob, Jane, Mike
Training = Zak
-Here to put different users into different groups, the following in the set Directory access, the directory to operate on it.

# Specify default access rules for all libraries
# Everyone can read, admin can write, dangerous molecule without any authority
[/]– corresponds to my test:/U02/SVN directory
* = R
@admin = RW
Dangerman =

# allows developers to have full access to their project version library
[proj1:/]
@devteam1 = RW
[proj2:/]
@devteam2 = RW
[bigproj:/]
@devteam1 = RW
@devteam2 = RW
Trevor = RW

# document writers have write access to all docs directories
[/trunk/doc]
@docs = RW

# trainers can fully access the Training version library
[trainingrepos:/]
@training = RW

Below we will configure our Authz file:
[Root@singledb conf]# Cat Authz
[Groups]
admin = Dave
Dev=tianlesoftware
[davesvn:/]
@admin = RW
@dev = RW
[Root@singledb conf]#

2.4 Start and stop SVN service
(1) Start SVN service:
[Root@singledb conf]# svnserve-d-R/U02/SVN
-D indicates background run
-r specifies that the root directory is/U02/SVN
[Root@singledb conf]# Ps-ef | grep SVN
Root 4592 1 0 18:04? 00:00:00 svnserve-d-R/U02/SVN
Root 4594 3709 0 18:04 pts/1 00:00:00 grep svn
(2) Stop SVN service:
Ps-aux |grep SVN
Kill-9 process Kill

Three. Client Connection SVN server

3.1 Installing the TORTOISESVN client
The download address is described in the first section.

3.2 Find the directory of your own project, right-click, and perform SVN operations
(1) New test directory SVN, after entering the right button, point checkout:

The IP address and version library name of the SVN server.

Create a new file svn.txt. Upload this file to the SVN server (add):

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.