Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Configuration record of SVN

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Scene description: recently, my friend's company wants to build a set of version control software. Let me recommend it. I told him that either SVN or GIT is OK. Finally, he chose to use SVN as version control. I simply wrote a document with him to introduce him:

What is SVN?

1 、 subversion

2. SVN is a version management tool

3. All data is concentrated in archives, similar to FTP tools.

4. Manage any element (file). Ftp is only a tool for uploading and downloading any changes at any time. (SVN will back up and record every change of each file.)

Commonly used version management tool: vss,cvs,svn,git

Second, the simple difference between svn and git:

1. Svn is a centralized version management and git is a distributed version control.

2. If svn wants to do version management, it must be submitted to the server, and git, even if the server is disconnected, can still do version control locally.

3. GIT stores content as metadata, while SVN stores content by file.

4. GIT does not have a global version number, while SVN has

5. The content integrity of GIT is better than SVN.

Reference: http://www.oschina.net/news/12542/git-and-svn

3. Which version management should be mastered by operation and maintenance personnel:

For the version management system, the technical points that the operators need to master:

1. Installation, deployment, maintenance, troubleshooting

2. Simple and practical, many companies are managed by developers, including setting up new warehouses and adding and deleting accounts

3. For the version control system, the operation and maintenance personnel are equivalent to the developers, the developers are the owners, and the system built by the operation and maintenance personnel serves the developers.

Fourth, SVN service operation mode and access mode

1. Independent server access

Access address such as: svn://svn.test.com/os

2. Rely on http services such as apache

Access address such as: http://svn.test.com/os

A) install apache+svn separately (do not use)

B) CSVN (apache+svn) is a separate integrated software, SVN software with web interface management

3. Local direct access

File:///application/svndata/os

Recommend svn and csvn web management

5. The working principle of SVN

In client / server mode-each version of the project file is saved in the server's version library, and all programmers involved in collaborative development keep a working copy on their local computer.

SVN allows programmers to update the local copy to the latest version on the server side, and the latest changes to the local copy to the server, and subsequent updates do not overwrite the previous update, but are saved as a new version-SVN even supports restoring the local working copy to a historical version saved on the server side.

6. Basic operation of SVN:

1, check out (checkout): download the whole project created by a server to local, which is the first step to participate in the development after joining the project team, which only needs to be executed once.

2. Update: update the local file to the latest version on the server side, usually once a day at work or before modifying the public file.

3. Commit: submit local changes to the server. It is usually performed before the end of the day or every time a function is implemented or a module is completed.

7. Installation and configuration of SVN:

[root@LVS-DR01 ~] # yum-y install subversion [root@LVS-DR01 ~] # rpm-qa subversionsubversion-1.7.14-10.el7.x86_64 [root@LVS-DR01 ~] # svnserve-versionsvnserve, version 1.7.14 (r1542130) compiled Nov 20 2015, 19:25:09Copyright (C) 2013 The Apache Software Foundation.This software consists of contributions made by many people See the NOTICEfile for more information.Subversion is open source software, see http://subversion.apache.org/The following repository back-end (FS) modules are available:* fs_base: Module for working with a Berkeley DB repository.* fs_fs: Module for working with a plain file (FSFS) repository.Cyrus SASL authentication is available. Create a svn data directory. The default svn directory is / var/svn We need to create manually: [root@LVS-DR01 ~] # mkdir-p / var/svn initialize the warehouse using svnadmin: [root@LVS-DR01 ~] # svnadmin create / var/svn [root@LVS-DR01 ~] # tree / var/svn/var/svn ├── conf │?? ├── authz │?? ├── passwd │?? └── svnserve.conf ├── db │?? ├── current │?? ├── format │?? ├── fsfs.conf │?? ├── fs-type │?? ├── min-unpacked-rev │?? ├── revprops │?? │?? └── 0 │?? │?? └── 0 │?? ├── revs │?? │?? └── 0 │???? 0?? transactions?? txn-current?? ── txn-current-lock │?? ├── txn-protorevs │?? ├── uuid │?? └── write-lock ├── format ├── hooks │?? ├── post-commit.tmpl │?? ├── post-lock.tmpl │?? ├── post-revprop-change.tmpl │?? ├── post-unlock.tmpl │?? ├── pre-commit.tmpl?? pre-lock.tmpl?? ├── pre-revprop-change.tmpl │?? ├── pre-unlock.tmpl │?? └── start-commit.tmpl ├── locks │?? ├── db.lock │?? └── db-logs.lock └── README.txt10 directories 27 files [root@LVS-DR01 ~] # cd / var/svn/conf/ [root@LVS-DR01 conf] # lltotal 12 passwd-rw-r--r-- [root@LVS-DR01 conf] # cp svnserve.conf svnserve.conf.bak-1 root root 1080 Jun 14 14:59 authz-rw-r--r-- 1 root root 309 Jun 14 14:59 passwd-rw-r--r-- 1 root root 3090 Jun 14 14:59 svnserve.conf [root@LVS-DR01 conf]

8. Activate the SVN service:

[root@LVS-DR01 ~] # systemctl start svnserve.service [root@LVS-DR01 ~] # systemctl status svnserve.service [root@LVS-DR01 ~] # systemctl enable svnserve.serviceCreated symlink from / etc/systemd/system/multi-user.target.wants/svnserve.service to / usr/lib/systemd/system/svnserve.service.SVN opens port 3690 by default Check: [root@LVS-DR01 ~] # lsof-I: 3690COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEsvnserve 60317 root 3u IPv4 286761 0t0 TCP *: svn (LISTEN) [root@LVS-DR01 ~] # netstat-antp | grep svntcp 00 0.0.0.0 antp 3690 0.0.0.0 * LISTEN 60317/svnserve

IX. Modify the default location of SVN

Install SVN directly using yum under CentOS7, and modify the location of the SVN default project [root@LVS-DR01 svn] # mkdir-p / dawnpro/svn [root@LVS-DR01 conf] # vim / etc/sysconfig/svnserve# OPTIONS is used to pass command-line arguments to svnserve.# # Specify the repository location in-r parameter:OPTIONS= "- r / dawnpro/svn" # OPTIONS= "- r / var/svn" description: adjust the / var/svn directory to / dawnpro/svn [root@LVS-DR01 conf] # systemctl restart svnserve

Create a directory of svn version libraries

[root@LVS-DR01 svn] # cd / dawnpro/svn/ [root@LVS-DR01 svn] # mkdir-p EIP EMS SAP [root@LVS-DR01 svn] # svnadmin create EIP [root@LVS-DR01 svn] # svnadmin create EMS [root@LVS-DR01 svn] # svnadmin create SAP [root@LVS-DR01 svn] # lltotal 0drwxr-xr-x 6 root root 86 Jun 16 21:56 EIPdrwxr-xr-x 6 root root 86 Jun 16 21:56 EMSdrwxr-xr-x 6 root root 86 Jun 16 21:57 SAP

11. Create a new directory to uniformly manage user rights

[root@LVS-DR01 ~] # mkdir-p / dawnpro/svn/conf/ [root@LVS-DR01 ~] # cp / dawnpro/svn/EIP/conf/* / dawnpro/svn/conf/ [root@LVS-DR01 ~] # cd / dawnpro/svn/conf/ [root@LVS-DR01 conf] # lsauthz passwd

XII. Modify the rights management file

[root@LVS-DR01 conf] # egrep-v "^ # | ^ $" authz [groups] EIP = EIP01,EIP02EMS = EMS02,EMS02SAP = SAP01 SAP02 [/] * = [EIP:/] @ EIP = rw* = [EMS:/] @ EMS = rw* = [SAP:/] @ SAP = rw* = description: a) * = users not defined above do not have any permissions b) @ EIP = rw means that the EIP group has rw permissions [root@LVS-DR01 conf] # egrep-v "^ # | ^ $" passwd [users] admin = EMS01EMS02 = EMS02EIP01 = EIP01EIP02 = EIP02SAP01 = SAP01SAP02 = SAP02 [root@LVS- DR01 ~] # egrep-v "^ # | ^ $" / dawnpro/svn/EIP/conf/svnserve.conf [general] anon-access = noneauth-access = writepassword-db = / dawnpro/svn/conf/passwdauthz-db = / dawnpro/svn/conf/authzrealm = EIP [root@LVS-DR01 ~] # egrep-v "^ # | ^ $" / dawnpro/svn/EMS/conf/svnserve.conf [general] anon-access = noneauth-access = writepassword-db = / dawnpro/svn/conf/passwdauthz-db = / dawnpro/ Svn/conf/authzrealm = EMS [root@LVS-DR01 ~] # egrep-v "^ # | ^ $" / dawnpro/svn/SAP/conf/svnserve.conf [general] anon-access = noneauth-access = writepassword-db = / dawnpro/svn/conf/passwdauthz-db = / dawnpro/svn/conf/authzrealm = SAP

13. Test the results of permission configuration

A) use the SVN client to access the SVN server

B) use the EIP01 account to access svn://10.10.10.101/EIP

C) Test upload "04-git birth. PNG", which is successful (the process is too short, so I didn't take a screenshot)

D) use another account for testing (use EMS01 account for testing)

E) prompt that there is no permission (test successful)

Note: after the SVN service modifies the configuration file, it can take effect without restarting the SVN service.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report