How to Install Apache Subversion (SVN) on CentOS 7

r00t August 4, 2018

Install Apache Subversion (SVN) on CentOS 7

In this tutorial we are going to learn how to install Apache Subversion (SVN) on CentOS 7. We will also install and configure its prerequisites. Subversion is a product of Apache Software Foundation. It helps you keep track of a collection of files and folders. Any time you change, add or delete a file or folder that you manage with Subversion, you commit these changes to your Subversion repository, which creates a new revision in your repository reflecting these changes. You can always go back, look at and get the contents of previous revisions.

I recommend to use a minimal CentOS server setup as a basis for the tutorial, that can be a virtual or a root server image with an CentOS 7 minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install Apache Subversion (SVN) on CentOS 7

Step 1. First, ensure your system and apt package lists are fully up-to-date by running the following:

yum -y install epel-release
yum -y update

Step 2. Installing Apache web server.

Install Apache server for accessing SVN server using HTTP URLs:

yum install httpd httpd-tools

Step 3. Installing Apache Subversion (SVN) on CentOS 7.

Now install latest available Subversion package using yum command line package manager utility:

yum install subversion subversion-tools mod_dav_svn

Let’s use the following command to verify the version of svn client:

svn --version

Step 4. Configure Subversion.

First, create repositories as per the requirements. In my case, i am creating /svn as the base and will create the repository in it:

mkdir /svn
svnadmin create /svn/testrepo

Change the permission of the repository:

chown -R apache:apache /svn/testrepo/

Next, configure virtual host in Apache:

nano /etc/httpd/conf.d/svn.conf

Place the following content:

<location /svn>
DAV svn
SVNParentPath /svn/
AuthType Basic
AuthName “Authorization Realm”
AuthUserFile /etc/subversion/svn.users
Require valid-user

Then, create additional users, use following commands:

htpasswd -cm /etc/subversion/svn.users ramona

Restart the apache server:

systemctl reload httpd.service

Step 5. Access Apache Subversion.

Use HTTP URLs to access your repository in the browser. It will prompt for authentication. Use login credentials created in above:


Congratulation’s! You have successfully install Apache Subversion (SVN) on your CentOS 7 server. Thanks for using this tutorial for installing Apache Subversion on CentOS 7 system.

The Tags:

Leave a Comment

Comments are closed.