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 of svn server for operation and maintenance operations

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

Share

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

Environment: CentOs6.1

Check whether the svn tool is installed: rpm-qa | grep subversion (View version: svnserve-- version)

(uninstalled ones can be installed with yum install subversion)

1. Establish the root directory of SVN

Mkdir-p / opt/svn/tshop/

2. Set up a product warehouse

Svnadmin create / opt/svn/tshop/

If your R & D center has multiple product groups, each product group can build a SVN warehouse

Description of the purpose of the catalogue:

Hooks directory: the directory where the hook script files are placed

Locks directory: the directory where subversion's db lock files and db_logs lock files are placed, and used to track clients accessing the file library

Format file: a text file with only an integer indicating the version number of the current vault configuration

Conf directory: is the configuration file of this warehouse (the user's access account, permissions, etc.)

3. Modify the version configuration library file

Vi / opt/svn/tshop/conf/svnserve.conf

Anon-access = none # Note it must be set here, otherwise all users can access it without a password.

Auth-access = write

Password-db = passwd

Authz-db = authz

Realm = tshop

Changes to the user profile take effect immediately, and there is no need to restart svn.

4. Start setting passwd user account information

Vi / opt/svn/tshop/conf/passwd

[users]

# harry = harryssecret

# sally = sallyssecret

# = the following is the user information I added = #

Chenmingchang = 123456

Svntest = 123456

5. Start setting up authz. User access rights

Vi / opt/svn/tshop/conf/authz

[groups]

Devteam = chenmingchang, svntest # devteam group includes two users

[/]

Chenmingchang = rw

Svntest = r

=

[tshop:/tb2c]

@ devteam = rw

Svntest =

[tshop:/tb2b2c]

@ devteam = rw

Chenmingchang = r

6. Note:

The user name that appears in the permission profile must have been defined in the user profile. Changes to the permission profile take effect immediately, and there is no need to restart svn.

User group format:

[groups]

=

One user group can contain one or more users, separated by commas.

Version library directory format:

[: / Project / Directory]

@ =

=

Among them, the part inside the box number can be written in a variety of ways:

[/], indicates the root directory and below. The root directory is specified when svnserve starts. We specify it as / opt/svn/tshop, and [/] means to set permissions on all version libraries.

[tshop:/] means to set permissions on the version library tshop

[tshop:/abc] means to set permissions on the abc project in the version library tshop

[tshop:/abc/aaa] means to set permissions on the aaa directory of the abc project in the version library tshop; the permission subject can be a user group, user or *, and the user group is preceded by @ and * to indicate all users. The br/ > permission principal can be a user group, user, or *. The user group is preceded by @ and * to indicate all users.

7. Launch svn:svnserve-d-r / opt/svn/tshop # the default startup port number is 3690

8. Check whether it is started: netstat-tunlp | grep svn (or ps-ef | grep svn)

9. Add svn to boot

Edit the rc.local file: vi / etc/rc.d/rc.local

Add and save the following startup command: / usr/local/svn/bin/svnserve-d-- listen-port 3690-r / opt/svn/tshop

10. If you want to stop svn, use the following command: killall svnserve (or pkill svn)

11. If you want to use svn as a service:

Create a new file named svn in the / etc/rc.d/init.d/ directory:

Touch / etc/rc.d/init.d/svn

And set the permission to 755:chmod 755 / etc/rc.d/init.d/svn

Edit the svn file: vi / etc/rc.d/init.d/svn and add the following code to it:

#! / bin/bash

# build this file in / etc/rc.d/init.d/svn

# chmod 755 / etc/rc.d/init.d/svn

You can use the following command to manage svn under # centos: service svn start (restart/stop)

SVN_HOME=/opt/svn/tshop

If [!-f "/ usr/local/svn/bin/svnserve"]

Then

Echo "svnserver startup: cannot start"

Exit

Fi

Case "$1" in

Start)

Echo "Starting svnserve..."

/ usr/local/svn/bin/svnserve-d-listen-port 9999-r $SVN_HOME

Echo "Finished!"

Stop)

Echo "Stoping svnserve..."

Killall svnserve

Echo "Finished!"

Restart)

$0 stop

$0 start

*)

Echo "Usage: svn {start | stop | restart}"

Exit 1

Esac

Save, and then you can start SVN as service svn start (restart/stop).

At this point, the svn server is configured.

The next article will explain how to use svn on the client.

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