Deploying SVN on Linux

Source: Internet
Author: User
Tags parent directory svn svn client svn update pkill egrep

===================== deploying SVN ===================== on Linux

2017-09-29 14:54:12

Personal original, reproduced please specify, otherwise investigate legal liability

Linux server-side installation configuration:

......................................................................................................................... .......

1,SVN Service side operation mode:
1), standalone server: Svn://www.snv.com/sadoc # Sadoc Project
2), with the help of Apache:http://www.svn.com/addoc
3), local direct access: File:///application/svn/sadoc #两个//followed by absolute path

2,linux on the construction steps:

Installation:
Yum-y Install Subversion

Create the root directory and password permissions directory for the SVN repository:
Mkdir-p/application/svndata
Mkdir-p/application/svnpasswd

Start, specify the root directory of SVN
Svnserve-d-r/application/svndata (-D: Background run,-r: Path)

To see if the process started:
Ps-ef |grep SVN
NETSTAT-PLNT |grep 3690 (SVN's port number is 3690)
Lsof-i tcp:3690 (or: lsof-i: 3690)

To build a repository:
Svnadmin Create/application/svndata/sadoc (can also be understood as a project, this directory cannot be created with mkdir, because SVN has its own way of running, will create a lot of svn own files)
tree/application/svndata/(You will find a lot more content in Sadoc)

To modify a configuration file:
Cd/application/svndata/sadoc/conf
CP svnserve.conf Svnserve.conf.bak

Egrep "\-access|\-db=" svnserve.conf (Egrep can filter two strings at a time =grep-e)
Change to: (All to shelf write the following content)
[General]
Anon-access=none does not allow anonymous access
Auth-access=write allowed to write
PASSWORD-DB =/APPLICATION/SVNPASSWD/PASSWD The specified user-password file
authz-db =/application/svnpasswd/authz A file that specifies user rights
Realm= This is Project 1
Description
Anon-access = None #不允许匿名用户访问
auth-access = Write #通过验证的用户可以读和写
Password-db =/opt/svn/etc/svn-user.conf #用户保存文件
Authz-db =/opt/svn/etc/svn-authz.conf #权限管理文件
Realm = My First Repository #仓库名称
To modify the password and permissions profile:
cp/apllication/svndata/sadoc/conf/passwd/apllication/svndata/sadoc/conf/authz/apllication/svnpasswd/
cd/apllication/svnpasswd/
chmod 700 * (the original permission is 644 because anyone can see it because SVN's password is clear)
Vim passwd (last line Add)
Oldboy = 111111
Test = 111111
Test = 222222
Vim Authz (Here you can define group information.) Attention. The members of the group must be defined in the passwd, not casually written, the group name can be casually up.
Ett_sa = Oldboy,test1 (defines an operations group: Members are: Oldboy and Test1)
Ett_wangguan = Test (defines a network management group with a member of test)
[sadoc:/] (Define Project Amount permissions: Project name Sadoc, which means all content under this item allows who can have what permissions)
@ett_sa = RW (If a group Ett_sa is allowed to be accessed, it is preceded by the @ symbol)
@ett_wangguan = R (Allow network management Group to view)
Test = R (if the permission is given to a user, it is directly in the "username = permissions" format)

Restart SVN
Pkill Svnserve
Ps-ef |grep SVN
Svnserve-d-r/apllication/svndata (here to svndata this directory, so in the client side asked the URL to continue to the end of the/sadoc, that is: Svn://192.168.115.80/sadoc)
Ps-ef |grep SVN (when you join only 1 items, you can svnserve .../application/svndata/sadoc, at which point the client accesses the url:svn://192.168.115.80)


Add SVN to the boot boot
Edit Rc.local File: vi/etc/rc.d/rc.local
Add the following start command:
/usr/local/svn/bin/svnserve-d–listen-port 9999-r/OPT/SVN
......................................................................................................................... .......

Client Installation configuration:

Install: Download the Turtle svn installed on Windows, install the Chinese version of the language pack, are all the way to solve the next
Connect: Create a new folder in the D drive: SVN client---Right-click: select: Svn-checkout (check out, first action, only this)
Fill in the address of the new server: Svn://10.0.0.6/sadoc/checkout's address W is: D:SVN client (recommended domain name, no IP) with default: Full recursive (fully recursive)
Enter user identification and password: (can appear this step: prove can connect to the server): oldboy,1111111 (then there will be more folders, and there is a. svn hidden file)

SVN submission Process:
Create a new document (the. svn folder's sibling directory) in this folder (as a new code submission) to the parent directory (svncheckout generated directory): Right-click:, Commit (Commit)
Check if the server is committed: Right-click (svncheckout generated directory)-TortoiseSVN---> Repo-browser


Extracting data and submitting data on Linux clients
Export: SVN chechkout svn://10.0.0.6/sadoc/data/test-------------------------Enter user name and password
Import: SVN import/data/oldboy/svn://10.0.0.6/sadoc-m "dddddddddddddd"--------------------------Enter user name and password

or abbreviated as: SVN co svn://10.0.0.6/sadoc/data/test
SVN cm/data/oldboy Svn://10.0.0.6/sadoc


Checkout is generally only used for the first time, later to update to the latest version with update on it.

To view data in SVN:
The graphical interface in the 1,windows can be viewed directly
2,linux: SVN ls svn://10.0.0.6/sadoc (ls---> list) (can only be viewed in a first-level directory)

......................................................................................................................... ...........


Use of hooks: hooks
When the version is updated, the hook program can be triggered, such as sending a message, and so on or other actions, is a can be triggered events and programs

1,post-commit
Post-commit: After the completion of the commit, the successful creation of the version, the execution of the hook, the submission has been completed, cannot be changed, so the return value of this script is fooled

Example: CP Post-commit.tmpl Post-commit
Vim Post-commit
Comment out the last line and add:
touch/tmp/$ (date +%m%s). log
chmod 755 Post-commit

2,pre-commit will make some restrictions on your submission, and the content of the script can be submitted. Non-conformance will be an error

Application of hooks in the build environment:
(1), limit the file name extension and size of the upload
(2), SVN Update automatically notify, MSN or mail or SMS, etc.
(3), the SVN update triggers the rsync push, the display version of the simultaneous update

......................................................................................................................... ...........................

Combat: SVN operation steps for deploying 4 projects on Linux:

[[email protected] ~]# yum-y Install Subversion
[Email protected] ~]# Svnserve--version
Svnserve, Version 1.6.11 (r934486)
......
[Email protected] ~]# mkdir-p/a/svn/
[Email protected] ~]# MKDIR/A/PASSWD
[Email protected] ~]# svnserve-d-R/A/SVN
[Email protected] ~]# svnadmin CREATE/A/SVN/REPO1
[Email protected] ~]# svnadmin CREATE/A/SVN/REPO2
[Email protected] ~]# svnadmin CREATE/A/SVN/REPO3
[Email protected] ~]# svnadmin Create/a/svn/repo4
[Email protected] ~]# cp/a/svn/repo1/conf/passwd/a/passwd/
[Email protected] ~]# cp/a/svn/repo1/conf/authz/a/passwd/
[Email protected] ~]# vim/a/svn/repo1/conf/svnserve.conf
[General]
Anon-access=none
Auth-access=write
Password-db =/a/passwd/passwd
Authz-db =/a/passwd/authz
realm=1111111111111111111111111111111111111
[Email protected] ~]# Mv/a/svn/repo2/conf/svnserve.conf/a/svn/repo2/conf/svnserve.conf.bak
[Email protected] ~]# Mv/a/svn/repo3/conf/svnserve.conf/a/svn/repo3/conf/svnserve.conf.bak
[Email protected] ~]# Mv/a/svn/repo4/conf/svnserve.conf/a/svn/repo4/conf/svnserve.conf.bak
[Email protected] ~]# cp/a/svn/repo1/conf/svnserve.conf/a/svn/repo2/conf/svnserve.conf
[Email protected] ~]# cp/a/svn/repo1/conf/svnserve.conf/a/svn/repo3/conf/svnserve.conf
[Email protected] ~]# cp/a/svn/repo1/conf/svnserve.conf/a/svn/repo4/conf/svnserve.conf
[Email protected] ~]# VIM/A/PASSWD/PASSWD
[Users]
Chen=chen123
Lu=lu123
Zhang=zhang123
Wang=wang123
Hua=hua123
Dong=dong123
[Email protected] ~]# Vim/a/passwd/authz
[Groups]
Java=chen,lu,zhang
Ios=wang
Web=hua
Jishu=dong
[repo1:/]
@java =RW
[repo2:/]
@ios =RW
[repo3:/]
@web =RW
[repo4:/]
@jishu =RW
[Email protected] conf]# chmod 700/a/passwd/*
[Email protected] ~]# Pkill svnserve
[Email protected] ~]# Ps-ef |grep SVN
Root 2405 2106 0 18:59 pts/1 00:00:00 grep svn
[Email protected] ~]# svnserve-d-r/a/svn/
[Email protected] ~]# Ps-ef |grep SVN
Root 2411 1 0 19:00? 00:00:00 svnserve-d-r/a/svn/
Root 2413 2106 0 19:00 pts/1 00:00:00 grep svn
[Email protected] ~]#

Deploying SVN on Linux

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.