Cpanel Install Mod_dav_svn

  1. Cpanel Install Mod_dav_svn Ubuntu

SVN Installation in Cpanel

In order to install SVN in server, we need mod_dav module in cpanel. Run the following command and check if the below modules are present:

Yum install moddavsvn subversion. If you have some sort of control panel such as CPanel installed then it would install its own httpd and Perl, meaning that you wouldn't be able to get at the packages in the base repo. Talk to your panel vendor if this is the case. Now issue yum command to install subversion and trac with pre-requisites. Yum -y install subversion trac moddavsvn modpython. Where mod-davsvn and modpython are apache modules which will be use later on to access subversion and trac. 2) Configuring Subversion. 2.1) Creating directories for Subversion. Mkdir /var/www/svn/svnrepos.

The module moddavsvn allows subverion to be served via Apache, because its installation is not allowed on shared server thats what I have learned. Hence many people fall for guide B, which can work for us by establishing svn connection over ssh (svn+ssh) however I am trying to bend the spoon to see if svn connection can be established over. I was hoping a more experienced person might be able to tell me if I risk any conflicts with cpanel if install subversion and moddavsvn using yum install as root: Code: yum install subversion moddavsvn. Also, the instructions have me making changes to the main apache config. This tutorial explains how to install Redmine with SVN on a cPanel/CentOS 5.6 server. Redmine is a flexible project management web application.

httpd -M grep dav
dav_module (static)
dav_fs_module (static)
dav_lock_module (static)
dav_svn_module (shared)

If dav_module is not installed in the server, you can enable it by running easyapache in the server. Enable DAV, DAVfs, DAVLock from the apache modules and build apache.

Next step is to install subversion in the server. For that, perform the following steps:

cd /usr/local/src/
rpm –import
rpm -K rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
rpm -i rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm

Once the repository is installed, install subversion using the following command:

yum –enablerepo=rpmforge install subversion

Now to build dav_svn_module, perform the following steps:

cd /usr/local/src
tar xfj subversion-1.6.3.tar.bz2
cd subversion-1.6.3
./configure –with-apxs=/usr/local/apache/bin/apxs –with-apr=/home/cpeasyapache/src/httpd-2.2.21/srclib/apr –with-apr-util=/home/cpeasyapache/src/httpd-2.2.21/srclib/apr-util
make install

If you get an error that sqlite-amalgamation needs to be installed, perform the following steps:

cd /usr/local/src
tar -zxvf sqlite-amalgamation-3.6.13.tar.gz
cd subversion-1.6.3
mkdir sqlite-amalgamation
cp ./sqlite-3.6.13/sqlite3.c ./sqlite-amalgamation/

Then build it again using the following commands:

./configure –with-apxs=/usr/local/apache/bin/apxs –with-apr=/home/cpeasyapache/src/httpd-2.2.21/srclib/apr –with-apr-util=/home/cpeasyapache/src/httpd-2.2.21/srclib/apr-util
make install

Now we need to configure apache and subversion.

mkdir -p /usr/local/apache/conf/userdata/std/2/<user>/<domain>/
vi svn.conf

Add the following lines to the file svn.conf

<IfModule mod_dav_svn.c>
<location name_of_svn>
DAV svn
SVNPath /home/<username>/public_html/name_of_svn
AuthType Basic
AuthName “SVN Repo”
AuthUserFile /home/<username>/.svn.htpasswd
Require valid-user

Add the username and password in the file /home/<username>/.svn.htpasswd using htpasswd command

htpasswd -cm /home/<username>/.svn.htpasswd username

In the file /usr/local/apache/conf/includes/pre_main_2.conf, add the following:

LoadModule dav_svn_module /etc/httpd/modules/
LoadModule authz_svn_module /etc/httpd/modules/

Now we need to create the SVn repository.

cd /home/<username>/public_html/
svncreate admin name_of_svn
chown -R user:user name_of_svn
chmod -R 775 name_of_svn

Now rebuild apache config and restart apache using the following commands:

/scripts/ensure_vhost_includes –user=username

That’s all.

In this howto i will describe how to install subversion with TRAC. Subversion is an open source version control system alternative to CVS and TRAC an enhanced wiki and issue tracking system for software development projects which provides an interface to Subversion. I install it on CentOS 5.4 which is already running as Web Server. I will use source to be maintain by Subversion and TRAC to track all development.

1) Installation

To install subversion and trac on CentOS 5.4 we will use dag repositories as it has latest packages (rpms) available for said softwares.

Red Hat Enterprise Linux / CentOS 5 / i386:

rpm -Uhv

Red Hat Enterprise Linux / CentOS 5 / x86_64:

rpm -Uhv

Now issue yum command to install subversion and trac with pre-requisites.

yum -y install subversion trac mod_dav_svn mod_python

where mod-dav_svn and mod_python are apache modules which will be use later on to access subversion and trac.

2) Configuring Subversion.

2.1) Creating directories for Subversion.

mkdir /var/www/svn/svnrepos
mkdir /var/www/svn/auth

2.2) User Authentication.

We will create a user to access SVN repositories

htpasswd -cb /var/www/svn/auth/svn.htpasswd svnuser1 passw0rd
Adding password for user svnuser1

2.3) Create Project Repository.

Now we will create a Project Repository. It can be user define name. I will choose name here for my Project Repository.

svnadmin create /var/www/svn/svnrepos/

svn mkdir file:///var/www/svn/svnrepos/ file:///var/www/svn/svnrepos/ file:///var/www/svn/svnrepos/ -m “Creating directories for initial import”

Committed revision 1.

Change ownership and group member to apache (default user for web server)

chown -R apache:apache /var/www/svn/svnrepos/

Generate configuration for svn to view from website.

vi /etc/httpd/conf.d/svn.conf

<Location /svn>
DAV svn
SVNListParentPath on
SVNParentPath /var/www/svn/svnrepos/

AuthType Basic
AuthName “ Site Repository”
AuthUserFile /var/www/svn/auth/svn.htpasswd
Require valid-user

Start service to take the changes.

/etc/init.d/httpd restart

Now browse your site to see the SVN repository.

It will ask the user/pass you created initially and after successful login you will see your repositories.

2.4) SVN Import for site files.

We will use svn import to import files from our site to repository to maintain the code.

svn import /home/sohail/public_html/
Authentication realm: Site Repository
Password for ‘root’ : <enter root password>
Authentication realm: Site Repository
Username : svnuser1
Password : passw0rd

Now browse your site and see the trunk folder, you will see your code listed there.

2.5) Branches

If you need to have multiple branches for your site then that is relatively very easy within subversion. All you need to copy from trunk to branches folder with user define name to recognized.

svn copy -m “1st Branch for Site”

3) Configure Trac.

First configure trac instance using trac-admin command for svn repository

trac-admin /var/www/trac/ initenv
Creating a new Trac environment at /var/www/trac/

Trac will first ask a few questions about your environment
in order to initalize and prepare the project database.


Please enter the name of your project.
This name will be used in page titles and descriptions.

Project Name [My Project]> Site

Please specify the connection string for the database to use.
By default, a local SQLite database is created in the environment
directory. It is also possible to use an already existing
PostgreSQL database (check the Trac documentation for the exact
connection string syntax).

Database connection string [sqlite:db/trac.db]> <Enter>

Please specify the type of version control system,
By default, it will be svn.

If you don’t want to use Trac with version control integration,
choose the default here and don’t specify a repository directory.
in the next question.

Repository type [svn]> <Enter>

Please specify the absolute path to the version control
repository, or leave it blank to use Trac without a repository.
You can also set the repository location later.

Download microsoft office 2007 crack version. Path to repository [/path/to/repos]> /var/www/svn/svnrepos/

Please enter location of Trac page templates.
Default is the location of the site-wide templates installed with Trac.

Templates directory [/usr/share/trac/templates]> <Enter>

Edit /etc/httpd/conf.d/trac.conf and change /var/trac to /var/www/trac at line starting from PythonOption TracEnvParentDir

vi /etc/httpd/conf.d/trac.conf

following line should be like this

PythonOption TracEnvParentDir /var/www/trac

Create user account for trac access

htpasswd -cb /var/www/trac/.htpasswd tracuser1 passw0rd

Change ownership and group member to apache of trac instances.

chown -R apache:apache /var/www/trac/

Restart webserver to take changes.

/etc/init.d/httpd restart

Now browse the site and you will see all available projects under trac and then open the project to browse by viewing source.

Please use comment for any help.

related posts

» Hosting / Servers, Linux » How To Install Subversion with TRAC..

Cpanel Install Mod_dav_svn Ubuntu

« Tip of the Day: How To Retrieve PLESK admin PasswordHow To Import Large MySQL Dump Files Using BigDump »