Setting Up a Subversion Server on CentOS Linux

Verify Existing Installation

Check whether Subversion is already installed:

rpm -qa | grep subversion

If output appears, remove the existing package before proceeding:

sudo yum remove -y subversion

Install Subversion via YUM

Install the latest stable version along with required dependencies:

sudo yum install -y subversion

Confirm installation location:

rpm -ql subversion | head -10

Prepare Repository Storage Directory

Create a dedicated directory structure for repositories:

sudo mkdir -p /var/svn/repositories

Initialize a New Repository

Create a sample repository named project-alpha:

sudo svnadmin create /var/svn/repositories/project-alpha

After creation, the repository directory contains:

  • conf/: configuration files for access control and authentication
  • db/: actual versioned filesystem data
  • hooks/: executable scripts triggered by repository events
  • locks/: lock management files
  • format: plain-text file indicatnig repository format version

Configure Access Control

Navigate to the repository's configuration directory:

sudo nano /var/svn/repositories/project-alpha/conf/svnserve.conf

Uncomment and adjust these lines:

[general]
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
realm = Project Alpha Repository

Edit user credentials in passwd:

sudo nano /var/svn/repositories/project-alpha/conf/passwd

Add users (format: username = password):

[users]
manager = securepass123
developer = devpass456

Define permissions in authz:

sudo nano /var/svn/repositories/project-alpha/conf/authz

Example policy:

[groups]
admins = manager
devs = developer

[/]
@admins = rw
@devs = r

[/src]
@devs = rw

Configure Firewall Rules

Allow SVN traffic through firewalld:

sudo firewall-cmd --permanent --add-port=3690/tcp
sudo firewall-cmd --reload

Verify firewall status:

sudo systemctl status firewalld

Start and Enable the SVN Service

Launch the daemon pointing to the repositories root:

sudo svnserve -d -r /var/svn/repositories

Confirm it’s running:

ps aux | grep svnserve

To enable automatic startup at boot:

sudo systemctl enable svnserve.service

Start or stop manually as needed:

sudo systemctl start svnserve.service
sudo systemctl stop svnserve.service

Test Client Cehckout

From a client machine (e.g., Windows with TortoiseSVN), use this URL to check out:

svn://<server-ip>:3690/project-alpha

Replace <server-ip> with the server’s IPv4 address (obtained via ip -4 addr show or hostname -I).

Tags: subversion centos svnserve version-control Linux-Server

Posted on Fri, 16 Oct 2026 16:27:37 +0000 by careym1989