CentOS Install and sync to web directory under SVN

Source: Internet
Author: User
Tags svn update yii

    • First, installation

Yum–y Install Subversion

Build the Repository Directory

Mkdir–p/mnt/svn

build svn repository

Svnadmin Create/mnt/svn/delieato

Start svn:

Svnserve–d–r/mnt/svn

    • Second, the configuration library

for each library, There are three configuration files (Authz,passwd,svnserve.conf) in the Conf directory

1, authz, set user groups and user rights

[Group]

Smsyun = DDL,SHL// Create a Smsyun group and develop two user DDL and SHL

[/]//The permissions under the custom directory / All resources under the Representative directory

@smsyun =RW//smsyun user group permissions are read and write

*=r// other users have read access only

2, passwd

[Users]

dd1=123// username = password

Dd2=123

3, svnserve.conf, the following four lines before the # removed

# anon-access = read// remove # and change read to none, anonymous user access not allowed
# auth-access = write// authenticated user can read and write
# password-db = passwd// user save file
# realm = Smsyun// warehouse name

Note: There must be no space in front of the modified file, otherwise there is an error starting SVN server

4, set the boot automatically start

Vi/etc/rc.local

Add a line below touch/var/lock/subsys/local

Svnserve–d–r/usr/local/svnrepo/first

    • third, synchronize to the Web directory

1. Set The web directory to /var/yii

2,Checkout a copy to the Web directory

SVN Co svn://localhost/smsyun/var/yii

3. Create a synchronization script

Create a new post-commit file under the /mnt/delieato/hooks directory

In the file, add:

#!/bin/sh

Repos= "$"

rev= "$"

Exportlang=en_us. UTF-8

Svn=/usr/bin/svn

Web=/var/yii

$SVN update $WEB--username dd1--password 123--no-auth-cache

then give the post-commit script Execute Permissions

Chmod +x Post-commit

The last action is to close the service and then open

Close:killall svnserve

Open:svnserve–d–r/mnt/delieato/svn


CentOS Install and sync to web directory under SVN

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.