How To Install Subversion On cPanel Server With Apache

This guide will help you to install SVN on a cPanel based server and configure it with Apache for ease of access.

In this tutorial, we will focus on creating multiple repositories instead of a single repository.



This setup is for servers with cPanel/WHM only. This can be installed on any cPanel/WHM server.


Download cPanelSVNManager and installl it


cd cPanelSVNManager_0.3



Select 1 from the menu and press Enter. This will install the latest version of the SVN and add necessary modules to Apache ( DAV etc )

Creating Configuration File


Assuming the following,

Domain Name:
Username: vivek

Open the file

/usr/local/apache/conf/includes/pre_main_global.conf and append the below block to that file


<Location /svn>
DAV svn
SVNParentPath /home/vivek/svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /home/vivek/svn/password
Require valid-user


Note: This would open /svn for all domains hosted in the account. If you would like to enable /svn path only for a specified domain, save this block of code into /usr/local/apache/conf/userdata/std/2/vivek/


Save the file and exit from the editor. Now create svn directory



mkdir /home/vivek/svn
chgrp -R nobody /home/vivek/svn
chmod -R g+w /home/vivek/svn


This would create the svn parent directory and setup correct folder permission so that apache can read it. By default, apache runs as nobody on cPanel server, therefore, the group should be changed to nobody so that apache has full read and write permission

Now, all our configurations have been completed and we have left with two tasks.

1. Create valid users
2. Create repositories

To create valid users who can log into svn type


/usr/local/apache/bin/htpasswd -c /home/vivek/svn/password admin


where “admin” is the username. You will be asked to enter a password. Type a password and continue. If you would like to add more users, simply use the same command but remove -c from the command.

To verify,type


cat /home/vivek/svn/password



To create a sample repository,


cd /home/vivek/svn
svnadmin create sample



Now, you would be able to access the repository under using the username and password that you just created.

Hope this helps

Leave a Reply

Your email address will not be published.