Setup SVN Tools and Repositories on Cpanel Servers
- Blog Category:
Once completed, you will have subversion client and server tools installed and Apache configured to serve a SVN repository over a shared SSL cert. If you are not familiar with compiling source on Unix systems, you may want to ask your support to help. I am not resposible for any isues the steps below may cause on your server (You have been warned!)
Provides:
Subversion 1.6.5
Apache modules
Shared SSL Cert
Note: You need root access to a cpanel install to perform the following. Some web hosts will setup SVN for you if you do not. Check with your support for details. Apache needs to be up to date and the dav module activated. Use /scripts/easyapache to do this. If you just want svn for use as a client, you can compile subversion and setup the path to /opt/svn/bin in your ssh profile.
Compile Subversion
% cd /opt
% wget http://subversion.tigris.org/downloads/subversion-1.6.5.tar.gz
% wget http://subversion.tigris.org/downloads/subversion-deps-1.6.5.tar.gz
% tar -xzf subversion-1.6.5.tar.gz
% tar -xzf subversion-deps-1.6.5.tar.gz
% cd subversion-1.6.5
% ./configure --prefix=/opt/svn --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.13/srclib/apr-util --with-ssl
% make
% make install
Next, edit ~/bash_profile and the svn binary path to your ssh environment path:
# path for svn
PATH=$PATH\:/opt/svn/bin
export PATH
Configure Apache
1. Add the following lines to the global pre-include file in WHM:
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
2. Follow instructions at http://svnbook.red-bean.com/ to create and manage a repository.
3. Configure a new SSL cert in WHM. This can usually be a shared cert for the server. If it is not a shared cert, an dedicated IP address will be required for the domain.
4. Go to the domain's home folder and create password file:
% htpasswd -cm svn-auth-file sv-auth-file
5. Add the following to httpd.conf in the SSL :443 vhost details for the domain that the cert has been setup for:
<Location /svn> DAV svn SVNPath /path/to/repo AuthType Basic AuthName "SVN Repository" AuthUserFile /home/user/svn-auth-file Require valid-user </Location>
If you want to follow cpanel apache config standards, create an include file like below:
Include "/usr/local/apache/conf/userdata/ssl/domain.com/svnconfig.conf"
Setup /home/user/public_secure as the shred SSL cert directory root. This helps to not conflict with Drupal or other web apps.
6. Restart apache and test.
% /scripts/restartsrv_httpd
A few resources that helped me refine this process:
1. http://svnbook.red-bean.com/
2. http://gnusys.net/kb/index.php/2009/04/installing-svn-on-cpanel-with-mod...
3. http://forums.cpanel.net/f42/how-setup-subersion-cpanel-75229.html









Recent comments
1 week 3 days ago
19 weeks 1 day ago
20 weeks 5 days ago
21 weeks 2 hours ago
21 weeks 1 day ago
23 weeks 6 days ago
24 weeks 3 days ago
24 weeks 3 days ago
27 weeks 1 day ago
27 weeks 1 day ago