Svn – Installing SVN on Centos 7


I am pulling my hair out on this, I am in the process of migrating a website and SVN server to a new Centos host, for the last few days I have been trying to get SVN working to no avail.

I have been able to get it to authenticate but it returns after loggin in 404 .

This morning for a test, I done a fresh install of Centos 7, disabled selinux and IPV6

and performed the following commands

yum install httpd subversion mod_dav_svn

vi /etc/httpd/conf.modules.d/10-subversion.conf

Alias /svn /var/www/svn
<Location /svn>
DAV svn
SVNParentPath /var/www/svn/
AuthType Basic
AuthName "SVN Repository"
AuthUserFile /etc/svn-auth-accounts
Require valid-user

htpasswd -cm /etc/svn-auth-accounts testuser
New password:
Re-type new password:
Adding password for user testuser

mkdir /var/www/svn
cd /var/www/svn/
svnadmin create repo
chown apache.apache repo/

systemctl restart httpd.service
systemctl enable httpd.service

Now this should setup a basic repo at ipaddress/svn/repo, but I get nothing only a 404 page.

I have tried Following the svn manual I reduced the server config to the smallest possible build being

<Location /repos>
  DAV svn
  SVNPath /var/www/svn/repo

It is still returning a 404 error.

I have tried placing the config for the svn in conf.d in a file called svn.conf to no avail as well.

systemctl status httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: active (running) since Fri 2019-06-28 14:08:46 AEST; 4s ago
     Docs: man:httpd(8)
 Main PID: 6272 (httpd)
   Status: "Processing requests..."
   CGroup: /system.slice/httpd.service
           ├─6272 /usr/sbin/httpd -DFOREGROUND
           ├─6273 /usr/sbin/httpd -DFOREGROUND
           ├─6274 /usr/sbin/httpd -DFOREGROUND
           ├─6275 /usr/sbin/httpd -DFOREGROUND
           ├─6276 /usr/sbin/httpd -DFOREGROUND
           └─6277 /usr/sbin/httpd -DFOREGROUND

SELinux status:                 disabled

I know in Ubuntu you need to enable mods for Apache in order for them to work, I can not find anywhere that says this also needs to be done for Centos.

Can anyone shed some light on what is happening here, I am truely lost,
the httpd error.log shows

[Fri Jun 28 14:21:49.153012 2019] [auth_digest:notice] [pid 6260] AH01757: generating secret for digest authentication ...
[Fri Jun 28 14:21:49.153800 2019] [lbmethod_heartbeat:notice] [pid 6260] AH02282: No slotmem from mod_heartmonitor
[Fri Jun 28 14:21:49.156392 2019] [mpm_prefork:notice] [pid 6260] AH00163: Apache/2.4.6 (CentOS) SVN/1.7.14 configured -- resuming normal operations
[Fri Jun 28 14:21:49.156430 2019] [core:notice] [pid 6260] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

From what I can tell, no slothmen is a common issue to ignore

Server version: Apache/2.4.6 (CentOS)
Server built:   Apr 24 2019 13:45:48

svn, version 1.7.14 (r1542130)
   compiled Apr 11 2018, 02:40:28

Copyright (C) 2013 The Apache Software Foundation.
This software consists of contributions made by many people; see the NOTICE
file for more information.
Subversion is open source software, see

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
  - handles 'http' scheme
  - handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
  - with Cyrus SASL authentication
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme

mod_dav_svn-1.7.14-14.el7.x86_64 already installed and latest version

Let me know if you need anything else

Thank you,
slighly less hair

Best Answer

You're almost there. Set SvnPath to /var/www/svn and surf to http://localhost/repos/repo.

Further steps:

  • reenable SELinux
  • adjust labels with semanage fcontext if needed. Likely semanage fcontext -a '/var/www/svn(/.*)?' -t httpd_sys_rw_content_t -u system_u -r object_r for your use case. Looking at httpd_selinux(8), that should already be present.
  • run restorecon to relabel, e.g. restorecon -Rv /var/www
  • enable TLS (Install and set up mod_ssl, see this for details. It's a little opinionated, but complete)