Subversion (SVN) is an open source version control system. It helps you keep track of a collection of files and folders. Any time you change, add or delete a file or folder that you manage with Subversion, you commit these changes to your Subversion repository, which creates a new revision in your repository reflecting these changes. You can always go back, look at and get the contents of previous revisions.
This article will help you for step by step setup SVN server on a cPanel/WHM server.
1. sqlite3 php module
2. Apache mod_dav module.
Installing php sqlite3 module
Run the following command in the server terminal
#php -m | grep sqlite
If the module is installed already, it will return
If the module is not enabled, run easyapache to enable the module
Installing mod_dav (if needed)
Run the following command in the terminal:
#httpd -M | grep dav
If mod_dav is already installed, it will return:
If this module is already enabled, run EasyApache and enable this module.
Note: If both sqlite3 and mod_dav is not enabled, you can install them in a single EasyApache.
In order to properly configure latest version of Subversion it needs to be compiled from its sources. Download and install subversion using the following commands.
Always check the https://subversion.apache.org/download/ for the latest version
#wget http://mirror.cc.columbia.edu/pub/software/apache/subversion/subversion-1.8.10.tar.gz tar xzvf subversion-1.8.10.tar.gz //unzip the file
#./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.2/srclib/apr-util/
Latest version of sqlite3 is needed. If the configure fails with following error:
An appropriate version of sqlite could not be found. We recommend 184.108.40.206, but require at least 3.7.12.
Please either install a newer sqlite on this system
get the sqlite 220.127.116.11 amalgamation from:
unpack the archive using unzip and rename the resulting
Then run following commands to enable latest sqlite3
#mv sqlite-amalgamation-3071501 sqlite-amalgamation
And run the configure again. It should work.
If the configure fails with following error
checking for APR… configure: error: the –with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.
You need to correct the “–with-apr-util=” path specified. Look for httpd-*.*.** (where the stars are your script version) and update accordingly and run the configure, make and make install commands.
Subversion and Apache
When using WHM and EasyApache, you can’t just modify the Apache configuration to include the Subversion modules. Instead, you must use the Include Editor, which you can find by browsing to “Apache Configuration” in the WHM menu. There, you must use the Pre Main Include. Select the latest Apache version from the dropdown list and a textarea will appear. Add the following to it and click on “Update”:
LoadModule dav_svn_module /usr/local/libexec/mod_dav_svn.so
LoadModule authz_svn_module /usr/local/libexec/mod_authz_svn.so
Set up your repository
use one repository per domain / subdomain. These instruction will work for multiple repositories.
For our explaining, consider the domain name is supportpro.com and support is the cPanel username.
First, you need to add a new virtual host for your repository:
#mkdir -p /etc/httpd/conf/userdata/std/2/support/supportpro.com
Next, you need to create the Subversion config file
And copy following to the svn.conf file. For every repository you wish to create, add another <location> block.
AuthName “SupportPro SVN”
Tell cPanel to update the Apache configuration to use the custom vhost includes:
#service httpd restart
Now, create the actual repository files:
#su svnaccount -
#svnadmin create svn
#chmod 775 -R svn
Add Subversion users
#/usr/local/apache/bin/htpasswd /home/support/public_html/passwd username
//enter password when asked.
Go to http://supportpro.com/svn to test your repository. It should ask for your user and password.