Svn deployment in linux

Source: Internet
Author: User
Tags svn update

Svn deployment in linux

 

The installation procedure is as follows:

1. yum install subversion

Yum-y install httpd

Yum install mod_dav_svn


2. Enter rpm-ql subversion to view the installation location, for example:
We know that svn has generated several binary files in the bin directory. Enter svn -- help to view how to use svn, as shown in.


3. Create the svn version library directory mkdir-p/var/svn/svnrepos
4. After creating the version library svnadmin create/var/svn/svnrepos and executing this command, the following files will be generated under the/var/svn/svnrepos directory:

5. Go to the conf directory (the svn version library configuration file). The authz file is the permission control file passwd, And the account password file svnserve. conf SVN service configuration file.
6. Set the account password vi passwd and add the user and password in the [users] block. Format: account = password,
For example, dan = dan
7. Add the following code at the end of vi authz: [/]
* = Dan = rw
Dan, the root directory of the version Library, has read and write permissions. w has only read permissions.
8. Modify the svnserve. conf file vi svnserve. conf. Open the following comments: anon-access = read # anonymous user-readable auth-access = write # authorized user-writable

Anon-access = none
Auth-access = write
Password-db = passwd # Which file is used as the account file authz-db = authz # Which file is used as the permission file # realm =/var/svn/svnrepos # Name of the authentication space, version library directory
9. Start the svn version library svnserve-d-r/var/svn/svnrepos
Test server svn co svn: // ip address

10. Test and create a new test folder on windows. Right-click the folder and select SVN checkout (to install TortoiseSVN in advance ):
Enter the SVN address, for example:
Enter the password, for example:

In linux, go to the svn co svn Directory: // ip address
Finally, remember to modify the Port:
Vim/etc/sysconfig/iptables

Service iptables restart Firewall


Initial charge 1: If you want to submit a file on the client, a directory under the server (for example, the directory named html) will also be automatically updated, using the following method
Step 1: Check out on the server
Svn co svn: // localhost/cocould html
Step 2: Create a post-commit File
[Root @ i-531-29129-VM hooks] # pwd
/Application/svndata/cocould/hooks
[Root @ i-531-29129-VM hooks] # vi post-commit
[Root @ i-531-29129-VM hooks] # cat post-commit
#! /Bin/bash
WEB =/var/www/html/
Export LANG = en_US.UTF-8
Svn update $ WEB -- username svnserver -- password 'svnserverpwd'

webDir=/var/www/web/svn_localapp=(center member operator shop queue)cd $webDirfor appName in ${app[@]};do cd $appName svn update cd $webDirdoneexit
Linux works in the same way as windows. The new file name is different. In the hooks directory under the storage directory of the SVN project version library, create a post-commit file: vi post-commit and add the following code :#! /Bin/sh WEB =/home/data/o135 export LANG = en_US.UTF-8 svn update $ WEB -- username o135 -- password 'o135123 'Save and exit .. Run the chmod 777 post-commit command to test whether the script has the permission./post-commit will automatically run the script each time the client submits the operation.

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.