Install svn and configuration through yum in linux, yumsvn

Source: Internet
Author: User

Install svn and configuration through yum in linux, yumsvn

1. Environment

Centos6.4

2. Install svn

Yum-y install subversion

3. Configuration

Create a version library directory

Mkdir/www/svndata

Svnserve-d-r/www/svndata

4. Create a version Library

Create a new Subversion Project

Svnadmin create/var/www/svndata/njlrxx

Configure to allow users to access jiqing

Cd/var/www/svndata/njlrxx/conf

Vi svnserve. conf

Anon-access = none

Auth-access = write

Password-db = passwd

Note: there must be no space before the modified file; otherwise, an error occurred while starting the svn server.

Vi passwd

[Users]

# <User 1 >=< password 1>

# <User 2 >=< password 2>

Jiqing = 123456

5. Client Connection

Svn co svn: // ip/njlrxx

Username: jiqing

Password 123456

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

6. To synchronize SVN and WEB, you can CO it or directly configure it in the repository.

1) set the root directory of the WEB server to/var/www/webroot.

2) checkout SVN

Svn co svn: // localhost/njlrxx/var/www/webroot/njlrxx

Modify permissions to WEB users

Chown-R apache: apache/var/www/webroot/njlrxx

3) create a synchronization script

Cd/var/www/svndata/njlrxx/hooks/

Cppost-commit.tmpl post-commit

Edit post-commit and add the following content at the end of the file:

REPOS="$1"REV="$2"BASEPATH=/var/www/webroot/njlrxxWEBPATH="$BASEPATH/"export LANG=zh_CN.UTF-8svn update $WEBPATH --username jiqing --password 123456 --no-auth-cache

Add script execution permission

Chmod + x post-commit

The final operation is to close the service and then open the service:

Close the svn service:

Killall svnserve

Svn enabled:

Svnserve-d-r/var/www/svndata

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

SVN automatic synchronization Program Execution Process:

1. the user submits the file to the SVN server and triggers the post-commit script after the submission is successful.

2. Run the PHP script in the post-commit file using php_script.php.

3. Update the working copy of the version library on the server through the exec system call in the PHP script

4. perform operations on another SVN version Library Based on the update operation result log

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.