How to configure Subversion on CentOS RedHat Linux

This documentation uses variables denoted with a $ followed by a keyword, all this emphasized with red text (i.e. $variable).  These variables should be replaced with appropriate values.  Suggested default values are denoted with a variable followed by an equal sign and a value (i.e $variable = value).

How to configure Subversion on CentOS, RedHat, Linux

  1. Create a Security Certificate for Subversion
    (see our OpenSSL Certificate Requestl tutorials)
  2. Create an HTTP Apache Virtual Host for Subversion
    (see our Apache Virtual Host tutorials)
  3. Create an HTTPS Apache Virtual Host for Subversion
    (see our Apache Virtual Host tutorials)
  4. Add the following text to the end of the HTTPS Apache Virtual Host directive, just above the Virtual Host ending tag (</VirtualHost>)
    <Location />
    DAV svn
    SVNParentPath /var/www/svn

    # List repositories in SVNParentPath
    SVNListParentPath on

    # Require SSL connection for password protection
    SSLRequireSSL

    AuthType Basic
    AuthName "Subversion Repository"
    AuthUserFile /etc/subversion/.htpasswd
    Require valid-user
    </Location>
  5. Add the following custom log entry to the # Logging section of the HTTPS Apache Virtual Host directive, just below the ssl custom log entry
    CustomLog logs/$domain-svn_logfile "%t %u %{SVN-ACTION}e" env=SVN-ACTION
  6. Redirect the HTTP Apache Virtual Host to the HTTPS Apache Virtual Host
    (see our Apache mod_rewrite tutorials)
  7. Create an authentication file with our first user
    htpasswd -cm /etc/subversion/.htpasswd $user
  8. Add additional users to our authentication file
    htpasswd -m /etc/subversion/.htpasswd $user

Now that we have Subversion configured, we need to create a repository for storing our versioned files.

Open Source Software: