Linux Build SVN server

Source: Internet
Author: User
Tags svn svn update

Install the SVN server-side yum install subversion from the image download install SVN server side If you follow the "Svnadmin Create/usr/local/svn/sunny" prompt error: "Command not Found" , hang the phrase "mount/dev/cdrom/media/cdrom/" before the phrase "Yum install subversion"

cd/usr/local///Enter directory, ready to create SVN directory

mkdir SVN//Create an SVN directory

Chmod-r 777 SVN//Modify directory permissions to 777

Svnadmin Create/usr/local/svn/sunny//Create an SVN version of the repository sunny (Sunny can casually name) to this step!!!!

CD svn/sunny/conf//Enter the configuration file directory under the sunny repository to modify the three profiles under this directory

(1) VI svnserve.conf//Configure repository information and user files and user password file path, repository path

# anon-access = Read

# auth-access = Write

# password-db = passwd//These four lines, the preceding # number and the space is removed (note to remove the # to shelf write, do not leave extra space), into

Anon-access = none//change to Noneauth-access = Write

Password-db = passwd

Realm = sunny//change to your repository save

(2) vi Authz//files, creating permissions for SVN Group and group users

[Group]

Sunny = GEP,WCE//Create a sunny group and specify two users GEP and WCE

[/]//define permissions under the root directory

@sunny = RW//sunny Group user rights are read and write

* = r//other users have read access only

Save exit

(3) VI passwd//Create or modify user passwords

[Users]

GEP = 123456//user named GEP has a password of 123456

WCE = 123456//user named WCE has a password of 123456

Save exit

Start svn:svnserve-d-r/usr/local/svn///Here in multi-repository mode if a single version of the library can be svnserve-d-r/usr/local/svn/sunny

Add a row and then set the self-start

Vi/etc/rc.local opening a self-boot file to add

/usr/bin/svnserve-d-r/usr/local/svn/

So far, you can check out files from the server.

. SVN command: NETSTAT-TNL |grep:3690 See if SVN is started

PS aux |grep ' svn ' finds all SVN-initiated processes kill-9 2505 kills 2505 of this found SVN process

SVN checkout Svn://172.19.5.2/sunny/data0/htdocs/blog//Check out a repository file to the specified directory

SVN up//update file

Automatic Updates

Join in the Vi/usr/local/svn/sunny/hooks/post-commit

#!/bin/sh# set some variables

Svn=/usr/bin/svn

WEB=/HOME/TESTSVN #要更新的目录

Export Lang=en_us. UTF-8$SVN update $WEB--username xxx--password xxx

Where svn= to the right of the SVN command location generally defaults to/USR/BIN/SVN

web= right to your actual web directory

Give executable permission chmod 777/usr/local/svn/sunny/hooks/post-commit

Installation Complete

=========================================================================

Other operations

#svn commit-m "Notes" xxx.php//Submit File

SVN ci-m ' AAA ' test.php//Submit File

#svn Add File//new files to SVN

SVN add *.php//(Add all PHP files in the current directory)

SVN delete test.php//delete test.php

SVN log test.php//view the log information of the test file

SVN cleanup//Clean up the current directory

SVN switch--relocate svn://192.168.1.253 svn://172.19.10.250//Relocate SVN repository address

SVN repository starting mode, now SVN has sunny, test two repository

1: Single-version library starter svnserve-d-r/usr/local/svn/sunny

2: Multi-version Library starter svnserve-d-R/USR/LOCAL/SVN

The difference is the start of the SVN command in the startup parameter-r specified directory.

To restrict different user permissions for different repository operations, modify the Authz file in the Conf directory in the Repository

To configure the sunny repository as an example

VI Authz

[Groups]

Teacher = Sunny,sunny1

[sunny:/]//Specify repository and directory permissions

@teacher = RW//teacher Group user rights are read and write

* = r//Other user only Read permission save exit

VI passwd set the user's account number and password in the group

[Users]

Sunny = 123456

Sunny1 = 123456

Linux Build SVN server

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.