How to install SVN (subversion) server on RHEL/CentOS and Fedora linux

Photo of author

By rasho

Subversion (SVN) is an open source version controling system. 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.
In this article i will show you how to install SVN server on RHEL/CentOS and fedora linux.
First, You need to install apache web server to access svn server using http urls.

# yum install httpd php php-devel php-cli php-pear -y

Starting Apache web server and configure to autostart on sistem boot:

# service httpd restart
# chkconfig httpd on

Install Subversion Using Yum command

Follow netxt command to install subversion and mod_dav_svn packages:

# yum install mod_dav_svn subversion -y

Configure subversion width apache:

# vi /etc/httpd/conf.d/subversion.conf
LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

   DAV svn
   SVNParentPath /var/www/svn
   AuthType Basic
   AuthName "Subversion User Authentication "
   AuthUserFile /etc/svn-users
   Require valid-user
Subversion Apache configuration file
Subversion Apache configuration file

Create first repository

[ads]
Use following command to create your fist svn repository.

# mkdir /var/www/svn
# cd /var/www/svn
# svnadmin create myrepo
# chown -R apache.apache myrepo

Add SVN Users:

# htpasswd -cm /etc/svn-users user
Add SVN Users
Add SVN Users

Access Your Repository in Browser

Use http urls to access your repository in browser http://ip.add.re.ss/svn/myrepo

Access Your Repository in Browser
Access Your Repository in Browser

Add Files to Repository

This step is for testing that repository is working properly. Use following commands to add few files to your svn repository.

# svn co http://ip.add.re.ss/svn/myrepo/
# cd myrepo
# touch file1.txt file2.txt
# svn add file1.txt file2.txt
# svn ci file1.txt file2.txt -m "initial commit"

Again check http://ip.add.re.ss/svn/myrepo/svn/myrepo/ url in browser.

1 thought on “How to install SVN (subversion) server on RHEL/CentOS and Fedora linux”

Leave a Comment