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
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: www.vivekv.com
Open the file
/usr/local/apache/conf/includes/pre_main_global.conf and append the below block to that file
AuthName "Subversion Repository"
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/vivekv.com/svn.conf
Save the file and exit from the editor. Now create svn directory
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 create a sample repository,
svnadmin create sample
Now, you would be able to access the repository under http://vivekv.com/svn/sample using the username and password that you just created.
Hope this helps