Installing SVN

howto install SVN (Subversion) server on Fedora , Red Hat (RHEL).

Install Packages:-

# yum install mod_dav_svn subversion

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

Add following config to /etc/httpd/conf.d/subversion.conf file:-

LoadModule dav_svn_module     modules/
LoadModule authz_svn_module   modules/

<Location /svn>
   DAV svn
   SVNParentPath /var/www/svn
   AuthType Basic
   AuthName "Subversion repositories"
   AuthUserFile /etc/svn-auth-users
   Require valid-user

How to Add SVN  users:-

Use  command:

## Create user vishal ##
htpasswd -cm /etc/svn-auth-users vishal
New password:
Re-type new password:
Adding password for user vishal

## Create testuser2 ##
htpasswd -m /etc/svn-auth-users vyas
New password:
Re-type new password:
Adding password for user vyas

How to Create and configure SVN repository:-

mkdir /var/www/svn
cd /var/www/svn

svnadmin create reponame
chown -R apache.apache reponame

chcon -R -t httpd_sys_content_t /var/www/svn/reponame

## Following enables commits over http ##
chcon -R -t httpd_sys_rw_content_t /var/www/svn/reponame
Goto http://localhost/svn/reponame address and you should see something like following, write username and password:  SVN testrepo revision 0: 

Create trunk, branches and tags structure under testrepo:-

Create “template” directories with following command:

mkdir -p /opt/vishal{trunk,branches,tags}

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

svn import -m 'Initial import' /opt/vishal/ http://localhost/svn/reponame
Adding         /tmp/svn-structure-template/trunk
Adding         /tmp/svn-structure-template/branches
Adding         /tmp/svn-structure-template/tags

Committed revision 1.

Check results on browser and see testrepo revision 1:- 

7 Responses to “Installing SVN”

  1. mohamed fahim February 1, 2012 at 2:09 pm #




    • Vishal Vyasas February 2, 2012 at 4:55 am #

      hi Fahim

      To install subversion, open a terminal and run the following command:

      sudo apt-get install subversion libapache2-svn

      sudo svnadmin create /svn

      gedit /etc/apache2/mods-enabled/dav_svn.conf

      The DAV line needs to be uncommented to enable the dav module

      # Uncomment this to enable the repository,
      DAV svn

      The SVNPath line should be set to the same place your created the repository with the svnadmin command.

      # Set this to the path to your repository
      SVNPath /svn

      # Uncomment the following 3 lines to enable Basic Authentication
      AuthType Basic
      AuthName “Subversion Repository”
      AuthUserFile /etc/apache2/dav_svn.passwd

      To create a user on the repository use, the following command:

      sudo htpasswd2 -cm /etc/apache2/dav_svn.passwd

      Restart apache by running the following command:

      sudo /etc/init.d/apache2 restart

      now you can access http://www.urIp/svn


  2. mohamed fahim February 3, 2012 at 10:02 am #

    hi master

    thanks a lot for your real help..

    mohamed fahim

  3. Nilesh Adiyecha May 26, 2012 at 7:16 am #

    Hi Vishal,
    I Have many time tried install SVN but when run this command chcon -R -t httpd_sys_content_t /var/www/svn/testsvn (My repository name)
    getting below Errors :
    chcon : can’t aplly partial context to unlabeled file ‘README.taxt’
    and so many line about that files which are in testsvn – repositorie folder

    So can you please help me on this.
    Thanks in advance !!!

  4. kumar December 17, 2013 at 6:29 am #

    hi vishal,

    can u please tell me how to configure Yum in rhel, i have installed rhel in vmware,i didnt install rhel through dvd,i just used the image file in my pendrive and i installed it..please tell me how to configure yum in this situation

    • Vishal Vyas December 17, 2013 at 7:20 am #

      Use EPEL repo if you have internet access or Extract RHEL Image file and copy.

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

%d bloggers like this: