Installation configuration for Subversion server under CentOS

Source: Internet
Author: User

1. Installation

# Yum Install Subversion


2. SVN configuration

Build the SVN repository directory to build multiple:
2.1 Create a new folder:

# mkdir-p/opt/svndata/repos

2.2 Build the SVN repository:

# svnadmin Create/opt/svndata/repos


2.3 Modifying the SVN repository configuration file repository:

# vi/opt/svndata/repos/conf/svnserve.conf

Content modified to:

[general]anon-access = noneauth-access = Writepassword-db =passwdauthz-db = Authzrealm = Repos

Note: Changes to the user profile take effect immediately and do not have to restart SVN.


2.4 Setting up users to access SVN

# VI/OPT/SVNDATA/REPOS/CONF/PASSWD

Passwd[users] is required and the file format is as follows:
[Users]
= = below list of users to access SVN, one row per user, example:

[users]username1 = Password1username2 = Password2


2.5 Configure SVN user access rights:

# Vi/opt/svndata/repos/conf/authz

Attention:
* The user name that appears in the permissions profile must already be defined in the user profile.
* Changes to the permissions profile take effect immediately and do not have to restart SVN.
User group format:

[Groups]groupname = Username1,username2

Of these, 1 user groups can contain 1 or more users, separated by commas between users.

Repository directory format:

[< Repository >:/Project/directory]@< user Group name > = < permissions >< User name > = < permissions >

Where the box number can be written in several ways:
[/], indicating the root directory and the following, the root directory is specified at svnserve startup, and we specify as/opt/svndata,[/] means to set permissions on all repository.
[repos:/] means setting permissions on repository repos
[REPOS2:/ABC] means setting permissions on the ABC project in the Repository Repos2
[REPOS2:/ABC/AAA] means setting permissions on the AAA directory for ABC items in the repository Repos2

A permission principal can be a user group, user, or *, and the user group is preceded by @,* to represent all users.
Permissions can be W, R, WR, and NULL, and NULL indicates no permissions.
Example:

[groups]admin = alan[/]@admin = rw[repos1:/abc/aaa]king = rw[repos2:/pass]king =

SVN configuration is complete.

3. Start SVN to build a user to start SVN

# useradd svn# passwd SVN

Follow the prompts to set a password for the user svn
Allow user svn access to repository:

# Chown-r Svn:svn/opt/svndata

Start SVN

# su-svn-c "svnserve-d--listen-port 9999-r/opt/svndata"

which
SU-SVN means to start svn as user svn
-d means running in daemon (background run)
–listen-port 9999 means using 9999 ports, which you can replace with the ports you need. Note, however, that using a port under 1024 requires root access
-r/opt/svndata specifies that the root directory is/opt/svndata
Check:
Ps-ef|grep Svnserve
If shown below, this is the start success:
SVN 6941 1 0 15:07? 00:00:00 Svnserve-d–listen-port 9999-r/opt/svndata
There are many ways to access SVN through the web, see Configuring WEBSVN or Configuring Bssvnbrowser methods.

Okay, all the configuration is complete, you can use the client svn to do it.

4. Server testing:

You should see the file Test.txt at this point.

Additional test methods:
# telnet {YOUR-SERVER-IP} 9999 check the port is not a pass
If the above check does not work, it is possible that the iptables is not open, set iptables can:
# Vi/etc/sysconfig/iptables
Add to:
-A output-p tcp-m tcp--dport 9999-j ACCEPT

Service Iptables Restart

Installation configuration for Subversion server under CentOS

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.