How to install Subversion on cPanel 11.50.x and higher

** Minimum HTTPD 2.4.16 required. HTTPD 2.4.12 will NOT work due to a security hole **

This tutorial will walk you through the steps to installing Subversion 1.8.14 on cPanel. You will end up with a command line version and the ability to access your SVN repositories via the browser securely.

If SVN is already installed on your server, be sure to remove it with 'yum remove svn'

Let's get started!

Install dependencies

yum install apr-devel zlib expat-devel
rpm -Uvh

Download Subversion source

cd /usr/local/src
sha1sum subversion-1.8.14.tar.gz
tar -zxvf subversion-1.8.14.tar.gz
cd subversion-1.8.14

Install sqlite-amalgamation

mv sqlite-amalgamation-3081101 sqlite-amalgamation

Install Serf

cd /usr/local/src
tar -xjf serf-1.3.8.tar.bz2
cd serf-1.3.8
scons APR=/usr/local/apache/bin/apr-1-config APU=/usr/local/apache/bin/apu-1-config PREFIX=/usr/local/serf
# If you run `scons check` you will get a fair number of errors. Ignore these.
scons install

Build and install Subversion

cd ../subversion-1.8.14
./configure --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apache/bin/apr-1-config --with-apr-util=/home/cpeasyapache/src/httpd-2.4/srclib/apr-util --with-openssl CC="gcc -std=gnu99" --with-serf=/usr/local/serf
make install

Link libraries

ln -s /usr/local/serf/lib/ /usr/local/lib/
ln -s /usr/local/serf/lib/ /usr/local/lib/

Verify we have a good version

svn --version
svn, version 1.8.14 (r1692801)
   compiled Aug 27 2015, 14:19:24 on x86_64-unknown-linux-gnu
Copyright (C) 2015 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_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
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - using serf 1.3.8
  - handles 'http' scheme
  - handles 'https' scheme

Add modules to Apache in cPanel

If you plan on accessing your SVN repositories in the browser, you can do this with mod_dav_svn and mod_authz_svn. You simply need to include these two modules in cpanel.

  1. Login to cpanel
  2. Navigate to Service Configuration --> Apache Configuration --> Include Editor
  3. Under Pre Main Include, select All Versions from the drop down.
  4. Add the following two lines

    LoadModule dav_svn_module     /usr/local/libexec/
    LoadModule authz_svn_module   /usr/local/libexec/
  5. Click on Update
  6. Click Restart Apache

You're done!

If everything went as it should have gone, you will now have Subversion installed on your cpanel box.

Configuring cPanel for web access to SVN

This is a quick how-to addendum as someone was asking how to do this. There are a few files you need to make SVN accessible from the browser. First up, you will need to add an apache configuration file for your domain. For the purpose of this how-to, our repositories are accessible from You can find more information on cPanel Apache config files here.

cd  /usr/local/apache/conf/userdata/ssl/2/
# This path is for https, if you use http, change the path below from ssl to std.
mkdir -p ./user/
# Past this into the file, being sure to first replace 'user' with your domains username and with your domain
<ifmodule mod_dav_svn.c="">
<location svn="">
    DAV svn
    SVNParentPath /home/user/svnrepos
    # our access control policy
    AuthzSVNAccessFile /home/user/svnauth/svn-access-file
    # only authenticated users may access the repository
    Satisfy Any
    Require valid-user
    # how to authenticate a user - change path to suit your needs
    AuthType Basic
    AuthName "SVN members only"
    AuthUserFile /home/user/svn_auth/svn-auth-file
    # location os xsl file. Change to suit your needs.
    SVNIndexXSLT "/css/svn/svnindex.xsl"
    ModMimeUsePathInfo on
<directory home="" user="" public_html="">
  AllowOverride None

You'll need to tell cpanel that you've added this file and then restart apache for the changes to take affect. Be sure to run a configtest (service httpd configtest) before restarting, in case you have a typo.

Next, you will need to be sure that you have the correct assets in place in the domain.

cd /home/
mkdir -p css/svn
vim svnindex.xsl
# paste the following into the svnindex.xsl file:
<!--?xml version="1.0"?-->
<!-- A sample XML transformation style sheet for displaying the Subversion
  directory listing that is generated by mod_dav_svn when the "SVNIndexXSLT"
  directive is used. -->
<xsl:stylesheet xmlns:xsl="" version="1.0">
  <xsl:output method="html"></xsl:output>
  <xsl:template match="*"></xsl:template>
  <xsl:template match="svn">
          <xsl:if test="string-length(index/@name) != 0">
            <xsl:value-of select="index/@name"></xsl:value-of>
            <xsl:text>: </xsl:text>
          <xsl:value-of select="index/@path"></xsl:value-of>
        <link rel="stylesheet" type="text/css" href="/svnindex.css">
        <div class="svn">
        <div class="footer">
          <xsl:text>Powered by </xsl:text>
          <xsl:element name="a">
            <xsl:attribute name="href">
              <xsl:value-of select="@href"></xsl:value-of>
          <xsl:text> </xsl:text>
          <xsl:value-of select="@version"></xsl:value-of>
  <xsl:template match="index">
    <div class="rev">
      <xsl:if test="string-length(@name) != 0">
        <xsl:value-of select="@name"></xsl:value-of>
        <xsl:if test="string-length(@rev) != 0">
          <xsl:text> — </xsl:text>
      <xsl:if test="string-length(@rev) != 0">
        <xsl:text>Revision </xsl:text>
        <xsl:value-of select="@rev"></xsl:value-of>
    <div class="path">
      <xsl:value-of select="@path"></xsl:value-of>
    <xsl:apply-templates select="updir"></xsl:apply-templates>
    <xsl:apply-templates select="dir"></xsl:apply-templates>
    <xsl:apply-templates select="file"></xsl:apply-templates>
  <xsl:template match="updir">
    <div class="updir">
      <xsl:element name="a">
        <xsl:attribute name="href">..</xsl:attribute>
        <xsl:text>Parent Directory</xsl:text>
    <!-- xsl:apply-templates/ -->
  <xsl:template match="dir">
    <div class="dir">
      <xsl:element name="a">
        <xsl:attribute name="href">
          <xsl:value-of select="@href"></xsl:value-of>
        <xsl:value-of select="@name"></xsl:value-of>
    <!-- <xsl:apply-templates/ -->
  <xsl:template match="file">
    <div class="file">
      <xsl:element name="a">
        <xsl:attribute name="href">
          <xsl:value-of select="@href"></xsl:value-of>
        <xsl:value-of select="@name"></xsl:value-of>
    <!-- xsl:apply-templates/ -->

Finally, you will need to create a CSS file to place in your site root (you can change the path if you wish for any of these files in the apache conf and the svnindex.xsl file

cd /home/
touch svnindex.css

If you now browse to you should see you content. It won't be pretty as you haven't added a style sheet yet. You can find a reasonable starting point for styles from this repository on Source Forge

Let me know if this works or not, I'm happy to update the tutorial if there are bugs.