CentOS6.4 install svn

Source: Internet
Author: User

CentOS6.4 install svn

Install svn on centos

1. svn Introduction
Subversion is a new generation of version control tools. It is not only used for program source code management, but also widely used in other tasks that require collaborative data management. As a CVS rewrite and release version, the goal is
Better Version Control Software replaces the popular CVS. I personally prefer to use git, but developers in the company prefer svn, so svn is deployed for them. Start installation.

2. Installation
It is too troublesome to compile the source code, or it is convenient to compile the rpm package. You can directly use yum for installation.

Yum install-y subversion

3. Create a repository
Svnadmin create/PATH/pro
Pro is the project name,/PATH/writable or not written. When not written, the pro directory is generated in the current directory where the command is executed. It is recommended to write the absolute PATH, at least clearly.
After the repository is created, the generated directory structure is as follows:
Pro
── Conf
│ ── Authz
│ ── Passwd
│ ── Svnserve. conf
── Db
│ ── Current
│ ── Format
│ ── Fsfs. conf
│ ── Fs-type
│ ├ ── Min-unpacked-rev
│ ── Rep-cache.db.
│ ── Revprops
│ ── 0
│ ── 0
│ ── Revs
│ ── 0
│ ── 0
│ ── Transactions
│ ── Txn-current
│ ── Txn-current-lock
│ ── Txn-protorevs
│ ── Uuid
│ ── Write-lock
── Format
├ ── Hooks
│ ── Post-commit.tmpl.
│ ── Post-lock.tmpl.
│ ── Post-revprop-change.tmpl.
│ ── Post-unlock.tmpl.
│ ── Pre-commit.tmpl.
│ ── Pre-lock.tmpl.
│ ── Pre-revprop-change.tmpl.
│ ── Pre-unlock.tmpl.
│ ── Start-commit.tmpl.
── Locks
│ ── Db. lock
│ ── Db-logs.lock.
── README.txt

4. modify the configuration file
The repository configuration file is as follows:
Conf
── Authz # user permission configuration file
── Passwd # user account password configuration file
── Svnserve. conf # repository configuration file

Modify svnserve. conf
[General]
Anon-access = none
Auth-access = write
Password-db = passwd
Authz-db = authz
Note: All rows must have the top level; otherwise, an error is returned.

Modify passwd
[Users]
Harry = harryssecret
Sally = sallyssecret
NOTE: If '#' exists before [users], svn can only use anonymous logon. All passwords here are plain text.

Modify authz and configure the user group and access permissions to different directories under [group ].
[Groups]
Admin = li # Set Group, admin group, including user li
Dev = long, ning # Set the group and admin group, including long and ning users.

[Pro:/] # Set the root directory permission of the Repository pro. The admin group has the read/write permission. * = set that the admin group cannot be accessed by others. * = do not have spaces in the middle. Otherwise, problems may occur.
@ Admin = rw
* =

[Pro:/dev] # Set the dev directory permission under the repository pro. the dev group has the read/write permission. * = set that no one else can access the directory. * = no space is in the middle. Otherwise, a problem may occur.
@ Dev = rw
* =

5. Start and Stop svn
Single warehouse:
Start: svnserve-d-r/PATH
Stop: kill-QUIT 'ps aux | grep svn | grep-v grep | awk' {print $2 }''

Multiple warehouses:
Most of the time, the same user needs to use the same account and password to access different versions of the database. In this case, the permission configuration is hard to handle, previously, the solution for others was in svnserve. specified in conf
When using passwd and authz paths, use relative paths to indicate the same file. This is a feasible method, but when adding a version library, you have to change the svnserve. conf file, which is inconvenient.
After carefully reading the help information of svnserve, you will find a-config-file parameter, which is used to specify svnserve. when it comes to the conf path, the problem is clear, as long as the SVN service is started
Specifies the-config-file parameter. If this parameter is specified, all permissions are granted by the svnserve specified by the parameter. conf control, and svnserve under the conf directory of each version library. conf configuration is ignored.
The parameters are as follows:
Svnserve-d-r/PATH-config-file/PATH/svnserve. conf
Because we use svn installed in yum, check/etc/rc. d/init. d/svnserve service startup script will find that the script will first determine whether the/etc/sysconfig/svnserve file exists. If yes, the file will be imported
So we only need to write the configuration information here, you can easily manage multiple version libraries, of course, you can also specify other locations, modify the script.
# Vim/etc/sysconfig/svnserve
OPTIONS = "-r/data/svn-config-file/data/svn/svnserve. conf"
Then, configure the specified authz and passwd files in the specified configuration file.
At this time, you can start svn just like starting other services.

Note: even if the svnserve service is already running, you can modify the configuration file or user or permission management file and save it immediately. You do not need to restart it.

Related Article

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.