Setup SVN Server ( SubVersion ) on CentOS

Posted: December 5, 2014 in Open source

Subversion (SVN) is an open source version control system. It helps you keep track of a collection of files and folders.

Step 1: Install Apache/PHP Packages

We need to install apache web server to access svn server using http urls.

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

Start Apache web server and setup to auto start on system boot

# service httpd restart
# chkconfig httpd on

Step 2: Install Subversion Using Yum

Use following command to install subversion and mod_dav_svn packages.

# yum install mod_dav_svn subversion

Step 3: Configure Subversion with Apache

Subversion creates an apache configuration file, we just need to make necessary changes to it.

# vim /etc/httpd/conf.d/subversion.conf
LoadModule dav_svn_module modules/
LoadModule authz_svn_module modules/

<Location /svn>
DAV svn
SVNParentPath /var/www/svn
AuthType Basic
AuthName “Subversion User Authentication ”
AuthUserFile /etc/svn-users
Require valid-user
Step 4: Create First SVN Repository

Use following command to create your fist svn repository.

# cd /var/www/svn
# svnadmin create myrepo
# chown -R apache.apache myrepo
Step 5: Add SVN Users

# htpasswd -cm /etc/svn-users user1

Step 6: Access Your Repository in Browser

Use http urls to access your repository in browser. It will prompt for authentication. Use login credentials created in Step 5.


[root@localhost]# elinks http://your_ip_address/svn/myrepo or use in your fav browser.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s