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 and configure svn stand-alone server under linux

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

Most people do not understand the knowledge points of this article "how to install and configure svn independent server under linux", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to install and configure svn independent server under linux" article.

File:///

Direct version library access (local disk).

Http://

By configuring the webdav protocol of the apache server for subversion.

Https://

Similar to http://, but includes ssl encryption.

Svn://

A protocol that is customized through svnserve services.

Svn+ssh://

Similar to svn://, but encapsulated by ssh

Svn also stores version data in two ways: bdb and fsfs. Because it is possible to lock data in bdb mode when the server is down, fsfs mode is more secure.

1. Svn server installation operating system: redhat linux as4

Get the svn installation package

Compile the svn and log in as the root user.

Transfer subversion-1.4.0.tar.gz and subversion-deps-1.4.0.tar.gz to the server.

Tar xfvz subversion-1.4.0.tar.gz

Tar xfvz subversion-deps-1.4.0.tar.gz

Cd subversion-1.4.0

. / configure-prefix=/opt/svn-without-berkeley-db-with-zlib

(note: run in svnserve mode without apache compilation parameters. Save the version library in fsfs format without compiling berkeley-db)

Make clean

Make

Make install

Vi / etc/profile, add at the end of / etc/profile:

Path=$path:/opt/svn/bin

Export path

Svn test svnserve-version

Svn is installed successfully if it is shown as follows:

Svnserve, version 1.4.0 (r21228)

Compiled oct 12 2006, 10:18:56copyright (c) 2000-2006 collabnet.

Subversion is open source software, see

This product includes software developed by collabnet (http://www.collab.net/).

The following repository back-end (fs) modules are available:

* fs_fs: module for working with a plain file (fsfs) repository.

2. You can create multiple directories of svn version library for svn configuration:

Mkdir-p / opt/svndata/repos1

Mkdir-p / opt/svndata/repos2

Establish svn version library svnadmin create / opt/svndata/repos1

Svnadmin create / opt/svndata/repos2

Modify the svn version library configuration file version library 1:

Vi / opt/svndata/repos1/conf/svnserve.conf

The content is modified to:

[general]

Anon-access = none

Auth-access = write

Password-db = / opt/svn/conf/pwd.conf

Authz-db = / opt/svn/conf/authz.conf

Realm = repos1

Version Library 2:

Vi / opt/svndata/repos2/conf/svnserve.conf

The content is modified to:

[general]

Anon-access = none

Auth-access = write

Password-db = / opt/svn/conf/pwd.conf

Authz-db = / opt/svn/conf/authz.conf

Realm = repos2

That is, except for realm = repos2, everything else is exactly the same as the version library 1 configuration file. If there are more version libraries, and so on.

Configure svn users vi / opt/svn/conf/pwd.conf that are allowed to access

To simplify the configuration, the two version libraries share one user profile. It can also be separated if necessary.

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

The file format is as follows:

[users]

=

=

Among them, [users] is necessary. Below is a list of users who want to access svn, one line for each user. Example:

[users]

Alan = password

King = hello

Configure svn user access vi / opt/svn/conf/authz.conf

To simplify the configuration, the three version libraries share a permission profile / opt/svn/conf/pwd.conf. It can also be separated if necessary. User group and version library directory permissions are defined in the file.

Note:

* the user name that appears in the permission profile must be defined in the user profile.

* changes to the permission configuration file 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:

/, indicating the root directory and below. The root directory is specified when svnserve starts, and we specify it as / opt/svndata. In this way, / means to set permissions on all version libraries.

Repos1:/, means to set permissions on version library 1

Repos2:/abc, which means to set permissions on the abc project in version 2

Repos2:/abc/aaa, which sets permissions on the aaa directory of the abc project in version library 2

The permission principal can be a user group, user, or *, and the user group is preceded by @, * to indicate all users. Permissions can be w, r, wr, and null, which means there are no permissions.

Example:

[groups]

Admin = alan

[/]

@ admin = rw

[repos1:/abc/aaa]

King = rw

[repos2:/pass]

King =

When svn is configured, delete the useless file rm / opt/svndata/repos1/conf/authz

Rm / opt/svndata/repos1/conf/passwd

Rm / opt/svndata/repos2/conf/authz

Rm / opt/svndata/repos2/conf/passwd

3. Start svn to establish the user useradd svn that starts svn

Passwd svn

Follow the prompts to set the password for user svn

Allow user svn to access version library chown-r svn:svn / opt/svndata

Chown-r svn:svn / opt/data

Start svnsu-svn-c "svnserve-d-- listen-port 9999-r / opt/svndata"

Where:

Su-svn means to start svn as user svn

-d means to run in daemon mode (running in the background)

-listen-port 9999 means to use port 9999, which can be replaced with the port you need. Note, however, that root permission is required to use ports below 1024

-r / opt/svndata specifies that the root directory is / opt/svndata

Check:

Ps-ef | grep svnserve

The startup is successful if it is displayed as follows:

Svn 6941 10 15:07? 00:00:00 svnserve-d-listen-port 9999-r / opt/svndata

There are many ways to access svn through web. See methods for configuring websvn or configuring bssvnbrowser.

The above is about the content of this article on "how to install and configure svn independent server under linux". I believe we all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

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: 282

*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

Internet Technology

Wechat

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

12
Report