Use SVN to automatically deploy code in Apache

Source: Internet
Author: User
Tags svn update

Use SVN to automatically deploy code in Apache

One problem occurs: svn, ftp, ftp, and svn. Is there a way to connect the two? In fact, you do not need the hooks (Hook) function provided by svn to meet your needs.

Svn configuration and settings can be directly found online. Let's talk about how to configure the automatic synchronization function. File post-commit.tmpl of/www/svn/repos/hooks under svn directory

This is the file to be modified, that is, what we need to do when svn has a commit.

1. Set the directory to be updated and check the corresponding directory on the configured homepage.

2. Modify the post-commit.tmpl file cp post-commit.tmpl post-commit

3. Edit the content of the post-commit file. Note that the post-commit file requires apache users to have the execution permission.

4.

Export LANG = zh_CN.UTF-8
REPOS = "$1"
REV = "$2"
WEB_PATH =/www/web/public_html_new/xxx
LOG_PATH =/www/web/log/svn_upload_log
CURDATE = "date"

Echo "code commit at $ CURDATE"> $ LOG_PATH
/Usr/bin/svn update $ WEB_PATH -- username -- password> $ LOG_PATH

Where:

WEB_PATH is the directory of the web page set in apache

LOG_PATH is the log directory.

After the execution is complete, connect to the local computer and submit the svn code online at the same time. Then, the code can be updated in real time.

Note that

You need to set the. svn directory in apache httpd. conf or the files contained in it to prohibit access.

<DirectoryMatch. * \. svn/. *>
Deny From All
</DirectoryMatch>

Install a Web Server on Ubuntu Server 14.04 (Linux + Apache + MySQL + PHP)

Install and configure the PHP environment in Linux (Apache2)

Install the LAMP \ Vsftpd \ Webmin \ phpMyAdmin service and settings in Ubuntu 13.04

Compile and install LAMP in CentOS 5.9 (Apache 2.2.44 + MySQL 5.6.10 + PHP 5.4.12)

Source code for Web server architecture in RedHat 5.4 build the LAMP environment and application PHPWind

Apache details: click here
Apache: click here

This article permanently updates the link address:

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.