Install SVN Server on Fedora 20/19, CentOS/RHEL 7/6.5/5.10

This is guide, howto install SVN (Subversion) server on Fedora 20/19/18/17/16/15/14, CentOS 7/6.5/5.10, Red Hat (RHEL) 7/6.5/5.10.

What is SVN (Subversion)?

Subversion is a free/open-source version control system. Subversion manages files and directories, and the changes made to them, over time. This allows you to recover older versions of your data, or examine the history of how your data changed. In this regard, many people think of a version control system as a sort of “time machine”.

Install SVN (Subversion) Server on Fedora 20/19/18, CentOS 7/6.5/5.10, Red Hat (RHEL) 7/6.5/5.10

1. Change root user

2. Install needed packages (mod_dav_svn and subversion)

Note: If you don’t have Apache installed already, this command installs it also. Read more about installing Apache and PHP >>

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

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

Read more SVN Access Control >>

4. Add SVN (Subversion) users

Use following command:

Note: Use exactly same file and path name as used on subversion.conf file. This example use /etc/svn-auth-users file.

Read more SVN Access Control >>

5. Create and configure SVN repository

Restart Apache:

Goto http://localhost/svn/testrepo address and you should see something like following, write username and password:
SVN Subversion username and password

SVN testrepo revision 0:
SVN Subversion Repository Revision 0

6. Configure repository

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

7. Create trunk, branches and tags structure under testrepo

Create “template” directories with following command:

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

Check results on browser and see testrepo revision 1:
SVN Subversion Repository Revision 1

Remember also take regular backups. Here is guide howto backup and restore SVN (Subversion) Repositories.

Our forums user Will have also written guide, howto to install and configure SVN (Subversion). This is little bit different method.

Share this post

301 Comments

  1. For some reason i dont get the popup of username password in domainzguru.com/svn/dgrepo

    Reply
  2. hi JR,
    now i can use my svn but i still don’t get the popup of username password in myDomain.com/svn/dgrepo on browser.

    here is my subversion.conf:

    LoadModule dav_svn_module modules/mod_dav_svn.so
    LoadModule authz_svn_module modules/mod_authz_svn.so

    #
    # Example configuration to enable HTTP access for a directory
    # containing Subversion repositories, “/var/www/svn”. Each repository
    # must be both:
    #
    # a) readable and writable by the ‘apache’ user, and
    #
    # b) labelled with the ‘httpd_sys_content_t’ context if using
    # SELinux
    #

    #
    # To create a new repository “http://localhost/repos/stuff” using
    # this configuration, run as root:
    #
    #
    # # cd /var/www/svn
    # # svnadmin create stuff
    # # chown -R apache.apache stuff
    # # chcon -R -t httpd_sys_content_t stuff
    #

    #
    # DAV svn
    # SVNParentPath /var/www/svn
    #
    # # Limit write permission to list of valid users.
    #
    # # Require SSL connection for password protection.
    # # SSLRequireSSL
    #
    # AuthType Basic
    # AuthName “Authorization Realm”
    # AuthUserFile /path/to/passwdfile
    # Require valid-user
    #
    #

    DAV svn
    SVNParentPath /var/www/svn/
    SVNListParentPath on
    AuthzSVNAnonymous Off
    AuthzSVNAuthoritative On
    SVNPathAuthz On
    AuthName Basic
    AuthName “SVN1 Repositories”
    AuthUserFile /etc/svn-auth-users
    AuthzSVNAccessFile /etc/svn-access-control
    Require valid-user

    do you have any idea about it?

    thank you very much.

    Reply
    • Hi lideth,

      Try to change following lines:

      To:

      Then restart httpd.

      Reply
  3. hi JR,
    i’ve already changed my subversion.conf,but it’s still nothing change.

    Reply
      • hi JR,

        i’ve already post my full configs to that URL for long time. but you not yet reply me back, how is that?

        thank you.

        Reply
        • Hi lideth,

          I couldn’t find any link to your “paste” from your comments? So could you also post link here…

          Reply
  4. hi JR,

    i just reconfig firewall..

    thanks

    Reply
  5. One thing you forgot to mention is that /var/www/svn is your apache web root. If its not, then you will run into permission trouble.

    Reply
    • Hi Hardik,

      Forgot to answer this, but actually you can see that on my example subversion.conf.

      SVNParentPath directory-path

      Specifies the location in the filesystem of a parent directory whose child directories are Subversion repositories. In a configuration block for a Subversion repository, either this directive or SVNPath must be present, but not both.

      Reply
  6. Hi,
    I am new to linux environment. When I tried to setup SVN using yum i am getting a below error.Could some one tel me how could I rectify it and proceed further?.

    Appreciate in advance..

    Thanks
    Beer

    Reply
  7. Adding the errors

    [root@gb02qsr010arcr7 ~]# yum install mod_dav_svn subversion
    Loaded plugins: product-id, security, subscription-manager
    This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
    file:///media/cdrom/fix/rhel5-x86_64/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: ‘/media/cdrom/fix/rhel5-x86_64/repodata/repomd.xml’
    Trying other mirror.
    Error: Cannot retrieve repository metadata (repomd.xml) for repository: yum_rpmsEL5-x86_64_level32. Please verify its path and try again
    [root@gb02qsr010arcr7 ~]#

    Reply
    • Hi Beer Mohamed,

      Looks like, you don’t have active RHEL subscription.

      This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

      Reply

Trackbacks/Pingbacks

  1. Install SVN Server on Fedora 13/14, CentOS/Red Hat (RHEL) 5.5/6 « svn - [...] WiÄ™cej: Install SVN Server on Fedora 13/14, CentOS/Red Hat (RHEL) 5.5/6 [...]
  2. Install SVN (Subversion) Server on Fedora 15/14, CentOS/Red Hat (RHEL) 5.6/6 | 資訊與工作 - [...] Install SVN (Subversion) Server on Fedora 15/14, CentOS/Red Hat (RHEL) 5.6/6 Install SVN (Subversion) Server on Fedora 15/14, CentOS/Red …

Submit a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">