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

How to install svn server in centos7 system

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

Share

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

This article is about how to install the svn server in the centos7 system, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

Environment:

The virtual machine is a centos7 system, the svn server is installed on the centos7 system platform, and the svn client is used on windows7 and centos7 systems respectively.

1. Install the svn server:

] # yum install subversion

2. Configure the svn server:

Establish the root directory and related directories of svn version library, that is, svndata and password permission command svnpasswd

] # mkdir-p / application/ {svndata,svnpasswd} svndata directory: as the root directory for storing svn; svnpasswd directory: as the user and password for logging in to svn

3. Start the svn service:

] # svnserve-d-r / application/svndata/ parameter:-d: indicates the daemon mode running in the background;-r: indicates the root directory of the svn service; check whether svn port 3690 has been listening: netstat-lntup | grep 3690

4. Set up a version library:

Under the / application/svndata/ directory, create the project sadoc:

] # svnadmin create / application/svndata/sadoc

A series of fixed directories are automatically created:

] # tree / application/svndata/sadoc

/ application/svndata/sadoc

├── 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.txt

Main directory description: conf directory: mainly configuration files, login users, password authentication Hooks directory: mainly the hook script template of svn. When you use it, you can remove the suffix .tmpl. The hook script is actually a script that can be executed separately before and after the code is submitted. The script can be written in perl, shell, python and other languages. The script file name in this directory represents the different times when the code is submitted for execution, such as the script pre-commit before the code submission and the script post-commit after the code submission. Learn more by yourself.

5. Modify the configuration file:

] # vim / application/svndata/sadoc/conf/svnserve.confanon-access = none # does not allow anonymous access, read allows anonymous access; auth-access = write # allows writable; password-db = / application/svnpasswd/passwd # password database authz-db = / application/svnpasswd/authz # control permission database

Note: the configuration file must be written at the top

Put the user and password files in a custom directory:

] # cp authz passwd/ application/svnpasswd/

Change the permission:

] # chmod 700 / application/svnpasswd/*

Configure the passwd file:

[users] oldboy = oldboysecrettest = testsecrettest1 = test1secret

Passwd profile description:

Format: svn account = svn password

Account number and password can be specified at will

Configure authz:

[groups] # define group information. Note: user account is in passwd; ett_sa = oldboy,test1ett_wangguan = Testt [sadoc: /] @ ett_sa = rw@ett_wangguan = rtest = r

Authz profile description:

1. The user that appears in the permission profile must already be defined in the user profile

two。 Changes to the permission profile take effect immediately, and there is no need to restart svn

3. A user group can contain multiple users, separated by commas

4. Version library directory format:

[: / / Project Directory]

@ =

=

Among them, the part in square brackets can be written in a variety of ways: [/]: indicates the root directory and below. The root directory is specified when svnserve starts. [/] means setting permissions on all version libraries; [repos:/]: setting permissions on the version library repos; [repos:/sadoc]: setting permissions on the sadoc project in the version library repos. [repos:/sadoc/oldboy]: sets permissions on the oldboy directory of the sadoc project in the version library repos; the permission subject can be a user, user group or *, and the user group is preceded by @ and * for all users; permissions can be w, r, wr and empty, indicating no permissions; every parameter in authz should be written with a top space, with no spaces at the beginning; for groups, start with @, but the user does not need to

6. Restart the svn service:

] # pkill svnserve] # svnserve-d-r / application/svndata/ Note: to change svnserve.conf, you need to restart svn, but you do not need to restart when you change authz or passwd files. Check whether port 3690 is listening, and the svn server is built. Here is the installation and use of svn client.

Describe the installation and use of svn clients on windows and centos7 platforms, respectively:

Svn client access method:

Subversion can be accessed in a variety of ways-local disk service, or a variety of different network protocols, but a version library address is always a url,url scheme that reflects the access method

1.file:// direct version library service (local disk or access method; 2. Http:// supports subversion's apache server through webdav protocol service; 3.https:// is similar to http:// but encrypted with ssl; 4.svn:// accesses svnserve server through unauthenticated tcp/ip custom protocol; 5. Svn+ssh:// accesses svnserve server through authenticated and encrypted tcp/ip custom protocol

1. Windows platform:

Download the svn client and install it. It's all mouse operation, so it's relatively easy.

Mainly explain the follow-up steps:

1. Create svn directories locally: for example, create svn-test directories

two。 Right-click on the directory and select SVN Checkout: then, fill in the svn server address, user name and other information according to the pop-up box; if you use checkout for svn for the first time, you will be required to enter a user name and password; save the authentication information in the default directory:% APPDATA%\ Subversion\ auth directory, enter:% APPDATA%\ Subversion\ auth in the run cmd window, that is, C:\ Users\ sshss\ AppData\ Roaming\ Subversion\ auth

Right-click on the directory:

Continue:

Click ok

This can be done.

3. In the created directory, write the code, then right-click in the directory and select SVN Commit to submit the code.

4. If you want to pull the code on the svn server, right-click the directory and select SVN Update.

Specific functions, learn by yourself, click the mouse on the line

2. Centos7 platform:

The main step is the svn command description:

1. Import the svn original directory:

First create a svn directory:] # mkdir / data/oldboy-p under its directory, create three directories:] # cd / data/oldboy; mkdir trunk branch tags-p Import:] # svn import / data/oldboy svn://192.168.255.12/sadoc/-m "import tree"

two。 To extract data from the svn library:

] # mkdir / data/test] # svn checkout svn://192.168.255.12/sadoc / data/test-- username oldboy-- password oldboysecret or abbreviation:] # svn co svn://192.168.255.12/sadoc / data/test-- username=oldboy-- password=oldboysecret or:] # svn co file:///application/svndata/sadoc / data/test-- username=oldboy-- password=oldboysecret Note: use checkout; for the first time to extract data without using username and password:

3. View the data in svn:

] # svn list-- verbose svn://192.168.255.12/sadoc or:] # svn ls-- verbose svn://192.168.255.12/sadoc] # svn cat svn://192.168.255.12/sadoc/trunk/test1.txt

4. Submit data to svn:

] # touch / data/test/trunk/test2.txt] # svn add / data/test/trunk/test2.txt] # svn ci-m "test2.txt" / data/test/trunk/test2.txt ci abbreviation: commit; co Note: add before commit when submitting

Use of 5.svn hook scripts (demonstrate only one)

Only demonstrate that the post-commit script uses:] # vim / application/svndata/sadoc/hooks/post-commit to comment out the default execution statement and add: touch / tmp/$ (date +% F). Log add execution permission:] # chmod 755 post-commit on the windows client, execute commit after modifying the data, and check on the linux command line to see if the hook script is executed; that is, a .log file named by time is created in the / tmp directory Note: 1. The permissions of the hook script should be allowed to be executed by svn, which is generally set to chmod 755 post-commit; 2. When writing a hook script, define variables as much as possible, mainly the path of used commands, because svn considers security issues and will not call system environment variables; 3. Before svn update, you must manually checkout a copy, and you must add a user and password here

The above is how to install the svn server in the centos7 system. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Original link: http://blog.51cto.com/linsj/2093655

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