Installing and Configuring Subversion

I also recently went through the process of installing and configuring subversion for a company.

Here were some of the notable steps






  1. Install subversion:
  • yum install subversion


  1. Install subversion mod_dav_svn plugin for apache 2.0 integration:
  • yum install mod_dav_svn


  1. Update the httpd.conf to load the module before any other subversion tasks. Add the following lines to /etc/httpd/conf.d/subversion.conf

    LoadModule dav_module         modules/

    LoadModule dav_svn_module     modules/


    * If the firewall has www turned off on machine, you must enable this.  For example, in fedora, this can be done via: 

            System-Security Settings and Firewall -> Add www to allowed



The following steps all happen on the server.

1. Make the svn repository

  • mkdir -p /home/repos/svn/vrepos
  • svnadmin create /home/repos/svn/vrepos
  • cchown –R apache.apache /home/repos/svn

    * Note for SELinux / Fedora Core 3+ / Red Hat Enterprise users: 

In addition to regular Unix permissions, under SELinux every file, directory, process, etc. has a ‘security context’. When a process attempts to access a file, besides checking the Unix permissions the system also checks to see if the security context of the process is compatible with the security context of the file.

Assuming your linux box has SELinux enabled, to run Subversion under Apache, you have to set the security context of the repository to allow Apache access (or turn off the restrictions on Apache, if you think all this is overkill). The chcon command is used to set the security context of files (similarly to how the chmod sets the traditional Unix permissions). For example, one user had to issue this command

chcon -R -h -t httpd_sys_content_t /home/repos/svn

2. Set up a directory to import

– mkdir /home/repos/tmpsvn/vrepos

– cd /home/repos/tmpsvn/vrepos

- mkdir branches

- mkdir tags

- mkdir trunk

- mkdir trunk/ThirdParty

- mkdir trunk/Build – add build scripts to this folder

- mkdir trunk/Source – add Stargate and EcoTool folders to this


  1. Add info to httpd configuration so that apache can serve repository and it will be password protected:


<Location /vrepos>

    DAV svn

    SVNPath /home/repos/svn/vrepos


    AuthType Basic

    AuthName "Subversion repository"

    AuthUserFile /home/repos/svn/svn-auth-file

    Require valid-user



  1. Add the users to the password file:
    1. For each user:

    $$ ### First time: use -c to create the file

    $ ### Use -m to use MD5 encryption of the password, which is more secure

    $ htpasswd -cm /home/repos/svn/svn-auth-file davidq

    New password: ***** 

    Re-type new password: *****

    $ htpasswd -m /home/repos/svn/svn-auth-file rossa

    New password: *******

    Re-type new password: *******

    Adding password for user rossa



  1. Configure Putty to go against repository:



This is how the repository will look on the 



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 )

Facebook photo

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

Connecting to %s