Set up SVN management service in CentOS6.4

Source: Internet
Author: User
Tags tortoisesvn

Set up SVN management service in CentOS6.4

1. svn server has two running Modes

1. independent server (for example, svn: // xxx.com/xxx );
2. Use apache. (For example: http://svn.xxx.com/xxx );
In order not to rely on apache, select the first method-independent svn server.
Svn also stores version data in two ways: 1.bdb; 2. fsfs.
Because the BDB method may lock data when the server is interrupted (it is vulnerable to ldap and cannot be cured), it is safer to use the FSFS method. I also choose this method.

My environment is CentOS6.4 + Nginx + Mysql5.5 + PHP5.4 environment script address: http://www.cnblogs.com/yangxiaofei/p/5015693.html

2. Download related software

1

2

Wget http://subversion.tigris.org/downloads/subversion-1.6.6.tar.gz

Wget http://subversion.tigris.org/downloads/subversion-deps-1.6.6.tar.gz

3. Edit

1) check whether the svn tool is installed

1

Rpm-qa | grep subversion

2) First, check whether the system has installed SSL.

Find/-name opensslv. h

If not, run the following command for installation:

Yum install openssl-devel-y

3) decompress the svn Installation File

Tar zxvf subversion-1.6.6.tar.gz
Tar zxvf subversion-deps-1.6.6.tar.gz

4) Compile and install

First install the compilation tool gcc

Yum install gcc *-y

./Configure -- prefix =/usr/local/svn -- with-openssl =/usr/include/openssl
-- Without-berkeley-db

Make & make install

5) test whether the installation is successful


/Usr/local/svn/bin/svnserve -- version

To facilitate operations, add svn-related commands to environment variables.

Echo "export PATH = $ PATH:/usr/local/svn/bin/">/etc/profile
Source/etc/profile

4. Configure svn

1. Create the SVN root directory

Mkdir-p/opt/svn/

2. Create a product warehouse

Mkdir-p/opt/svn/svnmanager/

Svnadmin create/opt/svn/svnmanager/

3. Modify the version configuration Library File

Vi/opt/svn/svnmanager/conf/svnserve. conf

The modified content is as follows:

### This file controls the configuration of the svnserve daemon, if you
### Use it to allow access to this repository. (If you only allow
### Access through http: and/or file: URLs, then this file is
### Irrelevant .)

### Visit http://subversion.tigris.org/for more information.

[General]
### These options control access to the repository for unauthenticated
### And authenticated users. Valid values are "write", "read ",
### And "none". The sample settings below are the defaults.
Anon-access = none // access without a password
Auth-access = write
### The password-db option controls the location of the password
### Database file. Unless you specify a path starting with /,
### The file's location is relative to the directory containing
### This configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
Password-db = passwd
### The authz-db option controls the location of the authorization
### Rules for path-based access control. Unless you specify a path
### Starting with a/, the file's location is relative to
### Directory containing this file. If you don't specify
### Authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
Authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they shocould
### Have the same password database, and vice versa. The default realm
### Is repository's uuid.
Realm = svnmanager

[Sasl]
### This option specifies whether you want to use the Cyrus SASL
### Library for authentication. Default is false.
### This section will be ignored if svnserve is not built with Cyrus
### SASL support; to check, run 'svnserve -- version' and look for a line
### Reading 'cyrus SASL authentication is available .'
# Use-sasl = true
### These options specify the desired strength of the security layer
### That you want SASL to provide. 0 means no encryption, 1 means
### Integrity-checking only, values larger than 1 are correlated
### To the cipher key length for encryption (e.g. 128 means 128-bit
### Encryption). The values below are the defaults.
# Min-encryption = 0
# Max-encryption = 256

Modifications to user configuration files take effect immediately without restarting svn.
4. Start setting passwd User Account Information

Vi/opt/svn/svnmanager/conf/passwd

The modified content is as follows:

### This file is an example password file for svnserve.
### Its format is similar to that of svnserve. conf. As shown in
### Example below it contains one section labeled [users].
### The name and password for each user follow, one account per line.

[Users]
# Harry = harryssecret
# Sally = sallyssecret
Yanghongfei = P @ ssw0rd

5. Set authz. User access permissions.

### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### Files.
### As shown below each section defines authorizations for the path and
### (Optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer:
###-A single user,
###-A group of users defined in a special [groups] section,
###-An alias defined in a special [aliases] section,
###-All authenticated users, using the '$ authenticated' token,
###-Only anonymous users, using the '$ anonymous' token,
###-Anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule '~ '. Rules can
### Grant read ('R') access, read-write ('rw ') access, or no access
###('').

[Aliases]
# Joe =/C = XZ/ST = Dessert/L = Snake City/O = Snake Oil, Ltd./OU = Research Institute/CN = Joe Average

[Groups]
# Harry_and_sally = harry, sally
# Harry_sally_and_joe = harry, sally, & joe

# [/Foo/bar]
# Harry = rw
# & Joe = r
# * =

# [Repository:/baz/fuz]
# @ Harry_and_sally = rw
# * = R

[Groups] // newly added
Devteam = yanghongfei
[/]
Yanghongfei = rw
[Svnmanager:/tb2c]
@ Devteam = rw
[Svnmanager:/tb2b2c]
@ Devteam = rw

6. Note:
* The user name displayed in the permission configuration file must be defined in the user configuration file.
* Changes to the permission configuration file take effect immediately without restarting svn.
User Group format:

[Groups]
=,
One user group can contain one or more users separated by commas.
Version library directory format:
[<Version library>:/project/directory]
@ <User group name >=< permission>
<User name >=< permission>

7. Create a user to start svn

Useradd svn

Passwd svn

Set a password for user svn as prompted
Allow user svn to access the version Library:

Chown-R svn: svn/opt/svn

8. Start svn

Method 1: svnserve-d-r/opt/svn/# The default start port number is 3690.
Method 2: su-svn-c "svnserve-d-listen-port 9999-r/opt/svn /"

Su-svn indicates to start svn as the user svn;
-D Indicates running in daemon mode (running in the background;
-Listen-port 9999 indicates port 9999, which can be replaced with the required port. Note that the root permission is required to use ports lower than 1024;
-R/opt/svn: Specify the root directory as/opt/svn.

9. Check whether startup is enabled.

Netstat-antp | grep svn

10. Add svn to startup

Vi/etc/rc. d/rc. local
// Add the following
/Usr/local/svn/bin/svnserve-d-r/opt/svn

11. To stop svn, run the following command:

Killall svnserve

Client Access

1. Download the Installation File
Windows 64-bit words download: TortoiseSVN-1.7.6.22632-x64-svn-1.7.4.msi
Windows 32-bit words download: TortoiseSVN-1.6.5.16974-win32-svn-1.6.5.msi

The address is as follows:
Svn: // {your-server-ip}: 9999/tshop/or svn: // {your-server-ip}: 3690/tshop/

For example, svn: // 172.17.0.7/svnmanager

Set up SVN server SVN in Ubuntu 14.04 ://

CentOS 6.2 SVN setup (YUM installation)

Deploy Apache + SVN in CentOS 6.5

Build an SVN server using Apache + SVN

Set up and use the SVN server in Windows + reset the password on the client

Install SVN in Ubuntu Server 12.04 and migrate Virtual SVN data

Build SVN service and migration method on Ubuntu Server

Subversion (SVN) Details: click here
Subversion (SVN): click here

This article permanently updates the link address:

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.