Install and configure the independent SVN server Subversionserver under CentOS6.X

Source: Internet
Author: User

Install and configure the independent SVN server Subversionserver under CentOS6.X

SubversionSVN, svn), an open-source version control system. Compared with the RCS and CVS, it adopts a branch management system, and its design goal is to replace CVS. Many version control *** services on the Internet have been transferred from CVS to Subversion. Svn servers can run in two ways: independent servers and apache. Next I will install the independent SVN


First, clear the yum cache. yum clean all

[1] install subversion

Yum install subversion-devel


Then select y (yes) to confirm installation. Of course, you can add the-y parameter during yum install. <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> Vc3ryb25np1_vc3ryb25np1_vcd4kpha + large/ewstews8m5p1_vc3ryb25np1_vc3ryb25np1_vcd4kpgltzybzcm9 "http://www.2cto.com/uploadfile/Collfiles/20141110/2014111009150367.png" alt = "\">

2. svn configuration multiple directories can be created for creating the svn version Library:
Mkdir-p/opt/svndata/repos1
Mkdir-p/opt/svndata/repos2
Create the svn version library svnadmin create/opt/svndata/repos1
Svnadmin create/opt/svndata/repos2
Modify svn version library configuration file version Library 1:
Vi/opt/svndata/repos1/conf/svnserve. conf
Modify the content:
[General]
Anon-access = none
Auth-access = write
Password-db =/opt/svn/conf/pwd. conf
Authz-db =/opt/svn/conf/authz. conf
Realm = repos1
Version library 2:
Vi/opt/svndata/repos2/conf/svnserve. conf
Modify the content:
[General]
Anon-access = none
Auth-access = write
Password-db =/opt/svn/conf/pwd. conf
Authz-db =/opt/svn/conf/authz. conf
Realm = repos2
That is, except realm = repos2, the other configuration files are exactly the same as those of version 1. If more version libraries are available, follow these steps.
Configure the svn user vi/opt/svn/conf/pwd. conf that can be accessed
To simplify the configuration, two version libraries share one user configuration file. If necessary, they can also be separated.
Note: modifications to user configuration files take effect immediately without the need to restart svn.
The file format is as follows:
[Users]
<User 1 >=< password 1>
<User 2 >=< password 2>
[Users] is required. The following lists the users who want to access svn. each user has a row. Example:
[Users]
Alan = password
King = hello
Configure svn User Access Permissions vi/opt/svn/conf/authz. conf
To simplify the configuration, the three version libraries share one permission configuration file/opt/svn/conf/pwd. conf. If necessary, they can also be separated. File.
Note:
* The user name displayed in the permission configuration file must be defined in the user configuration file.
.
* Modifications to the permission configuration file take effect immediately without restarting svn.
User Group format:
[Groups]
<User group name >=< user 1>, <user 2>
One user group can contain one or more users separated by commas.
Version library directory format:
[<Version library>:/project/directory]
@ <User group name >=< permission>
<User name >=< permission>
The box number can be written in multiple ways:
/, Indicating the root directory and the following. The root directory is specified when svnserve is started. We specify it as/opt/svndata. In this way,/sets permissions for all version libraries.
Repos1:/, indicating to set permissions for Version 1
Repos2:/abc, indicating to set permissions for the abc Project in version library 2
Repos2:/abc/aaa, indicating to set permissions for the aaa directory of the abc Project in version library 2
The permission subject can be a user group, user, or *. The user group is preceded by @, * indicating all users. The permission can be w, r, wr, or null. If it is null, no permission is granted.
Example:
[Groups]
Admin = alan
[/]
@ Admin = rw
[Repos1:/abc/aaa]
King = rw
[Repos2:/pass]
King =
Svn configuration is complete, delete useless files rm/opt/svndata/repos1/conf/authz
Rm/opt/svndata/repos1/conf/passwd
Rm/opt/svndata/repos2/conf/authz
Rm/opt/svndata/repos2/conf/passwd
3. Start svn and create useradd svn
Passwd svn
Set the user svn password as prompted
Allow user svn to access the version library chown-R svn: svn/opt/svndata
Chown-R svn: svn/opt/data
Start svnsu-svn-c "svnserve-d -- listen-port 9999-r/opt/svndata"
Where:
Su-svn indicates to start svn as user svn
-D Indicates running in daemon mode (running in the background)
-Listen-port 9999 indicates port 9999, which can be replaced with the required port. Note that the root permission is required to use ports lower than 1024.
-R/opt/svndata specifies that the root directory is/opt/svndata
Check:
Ps-ef "grep svnserve
If the following information is displayed, the instance is successfully started:
Svn 6941 1 0? 00:00:00 svnserve-d-listen-port 9999-r/opt/svndata

Add automatic start upon startup

Echo"Svnserve-d -- listen-port 9999-r/opt/svndata">/Etc/rc. local


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.