Install SVN Server on Fedora 23/22, CentOS/RHEL 7.1/6.7/5.11

This is guide, howto install SVN (Subversion) server on Fedora 23/22/21/20/19/18, CentOS 7.1/6.7/5.11, Red Hat (RHEL) 7.1/6.7/5.11.

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 23/22/21/20/19/18, CentOS 7.1/6.7/5.11, Red Hat (RHEL) 7.1/6.7/5.11

1. Change root user

2. Install needed packages (mod_dav_svn and subversion)

Fedora 23/22

Fedora 21/20/19/18 and CentOS / Red Hat (RHEL) 7.1/6.7/5.11

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

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

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

Fedora 23/22/21/20/19/18 and CentOS/Red Hat (RHEL) 7.1

LoadModule commands should be in /etc/httpd/conf.modules.d/10-subversion.conf file:

Read more SVN Access Control >>

CentOS/Red Hat (RHEL) 6.7/5.11

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

Read more about SVN (Subversion) Access Control with Apache and mod_authz_svn.

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

Share this post


  1. For some reason i dont get the popup of username password in

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

    here is my subversion.conf:

    LoadModule dav_svn_module modules/
    LoadModule authz_svn_module modules/

    # 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.

    • Hi lideth,

      Try to change following lines:


      Then restart httpd.

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

      • 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.

        • Hi lideth,

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

  4. hi JR,

    i just reconfig firewall..


  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.

    • 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.

  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..


  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 ~]#

    • 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.

  8. I am using Fedora 20. I followed your instruction for step 2 and the Apache & PHP installation. But I cannot find the subversion.conf file your mentioned in your step 3. The only similar is this:

    $ sudo find / -name *subversion.conf*

    My SVN was setup few months ago. I can access my svn via “svn://”. My web server can display your test.php correctly. I want to add “http://” access. I do did your step 2 successfully. What I should do? create the subversion.conf in that location? but how it can be used by the system?

  9. I Have following error message

    [root@localhost ~]# svn import -m ‘Initial import’ /tmp/svn-structure-template/ http://localhost/svn/testrepo/
    svn: E175002: Server sent unexpected return value (500 Internal Server Error) in response to POST request for ‘/svn/testrepo/!svn/me’

    Please help me.




  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 *