SVN (Subversion) Server on Red Hat (RHEL) 6.3/5.8

install needed packages (mod_dav_svn and subversion)

#yum install mod_dav_svn subversion

Modify Subversion config file : /etc/httpd/conf.d/subversion.conf

LoadModule dav_svn_module     modules/

LoadModule authz_svn_module   modules/

# Add the following to allow a basic authentication and point Apache to where the actual repository resides.

<Location /svn>

   DAV svn

   SVNParentPath /var/www/svn

   AuthType Basic

   AuthName “Subversion repositories”

   AuthUserFile /etc/svn-auth-users

   Require valid-user


Add SVN (Subversion) users

## Create testuser ##

[root@server~]# htpasswd -cm /etc/svn-auth-users testuser

## Create testuser2 ##

htpasswd -m /etc/svn-auth-users testuser2

Create and configure SVN repository

# mkdir /var/www/svn

# cd /var/www/svn

 # svnadmin create testrepo

# chown -R apache.apache testrepo

#  chcon -R -t httpd_sys_content_t /var/www/svn/testrepo

Following enables commits over http

# chcon -R -t httpd_sys_rw_content_t /var/www/svn/testrepo

#Restart Apache:

# service httpd restart

Configure repository

To disable anonymous access and enable access control add following rows to testrepo/conf/svnserver.conf file:

## Disable anonymous access ##

anon-access = none

 ## Enable access control ##

authz-db = authz

Create trunk, branches and tags structure under testrepo

Create “template” directories with following command:

# mkdir -p /tmp/svn-structure-template/{trunk,branches,tags}

Then import template to project repository using “svn import” command:

svn import -m ‘Initial import’ /tmp/svn-structure-template/ http://localhost/svn/testrepo/

Adding         /tmp/svn-structure-template/trunk

Adding         /tmp/svn-structure-template/branches

Adding         /tmp/svn-structure-template/tags

Committed revision 1.


About Manish Jha

Hi All I am Manish Kumar Jha aka Alex Hunt. I am currently working in Iono,Inc as Cloud Solutions Architect. I have around 8 Years of IT experience and have exposure on VMware vSphere, vCloud Director, RHEL and modern data center technologies like Cisco UCS and Cisco Nexus 1000v and NSX. If you find any post informational to you please press like and share it across social media and leave your comments if you want to discuss further on any post. Disclaimer: All the information on this website is published in good faith and for general information purpose only. I don’t make any warranties about the completeness, reliability and accuracy of this information. Any action you take upon the information you find on this blog is strictly at your own risk. The Views and opinions published on this blog are my own and not the opinions of my employer or any of the vendors of the product discussed.
This entry was posted in Server Configuration. Bookmark the permalink.

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s