Install SVN and configuration via Yum under Linux

Source: Internet
Author: User
Tags php script svn svn update

    • Environment

centos6.4

    • Install SVN

Yum-y Install Subversion

    • Configuration

Build the Repository Directory
Mkdir/lh/svndata

Svnserve-d-r/lh/svndata

To see if it started successfully: NETSTAT-LNT | grep3690 Ps-le | grep SVN

    • Build Repository

Create a new Subversion project

Svnadmin Create/lh/svndata/noc

Configure run user Paul Access

Cd/lh/svndata/noc/conf

Vimsvnserve.conf

ANON-ACCESS=NONEAUTH-ACCESS=WRITEPASSWORD-DB=PASSWD Note: There must be no space in front of the modified file, otherwise there is an error starting SVN server

Vim passwd

[users]#< User 1> = < password 1>#< user 2> = < password 2>paul = 123456

    • Client connections

SVN Co svn://ip/njlrxx
User name: Paul

Password: 123456

6. Implement SVN synchronization with the Web, can be a co-or directly in the warehouse

1) Set the Web server root directory to/var/www/webroot

2) Checkout a copy of SVN

SVN Co svn://localhost/njlrxx/var/www/webroot/njlrxx

Modify permissions for Web users

Chown-r Apache:apache/var/www/webroot/njlrxx

3) Create a synchronization script

cd/var/www/svndata/njlrxx/hooks/

CP Post-commit.tmpl Post-commit

Edit Post-commit, add the following at the end of the file

Repos= "$"

rev= "$"

Basepath=/var/www/webroot/njlrxx

Webpath= "$BASEPATH/"

Export LANG=ZH_CN. UTF-8

SVN update $WEBPATH--username Paul--password 123456--no-auth-cache

Increase script Execution permissions

chmod +x Post-commit

The last action is to turn off the service and then open the service:

The shutdown of the SVN service:

Killall Svnserve

SVN open:

Svnserve-d-r/var/www/svndata

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

SVN automatic synchronization program execution flow:
1, the user submits the file to the SVN server, the commit operation succeeds, triggers the Post-commit script
2. Execute PHP script in post-commit version file using php_script.php
3. Update the repository working copy on the server through the exec system call in the PHP script
4, according to the update operation results log, the other SVN repository for the corresponding operation processing

The SVN Windows client software is included: Https://pan.baidu.com/s/1mRi2_wEcMfFQVVGaVsxJXA

Install SVN and configuration via Yum under Linux

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.