Skip to Content


Tag Archives: SVN


Install SVN::Notify on CentOS

This assumes you already have an SVN repository setup.

First download perl pre-requisites:

yum install perl-CPAN
perl -MCPAN -e 'install SVN::Notify'
perl -MCPAN -e 'install SVN::Notify::HTML::ColorDiff'


yum install perl
perl -MCPAN -e 'install SVN::Notify'
perl -MCPAN -e 'install SVN::Notify::HTML::ColorDiff'

Next download SVN Notify from CPAN:

cd /home
tar zxf SVN-Notify-2.83.tar.gz
cd SVN-Notify-2.83/

Next run MAKE:

perl Build.PL
./Build test
./Build install

If that doesn’t work then try:

perl Makefile.PL
make test
make install

Now change to your SVN directory and then to the hooks directory:

cd /%SVN LOCATION HERE%/hooks/

Create a post-commit file using vim:

vim post-commit

Add this to the file (replace:

/usr/local/bin/svnnotify -r $REV -C -d -H HTML::ColorDiff \
-p $REPOS -t --from \

Save the script and give it execution permission:

chmod +x post-commit

Now every time someone commits to the SVN repository, an email notification will be sent.


Installing ViewVC (Debian 6)

This follows on from previous tutorial to install SVN in Debian:

Download and install ViewVC

sudo apt-get install viewvc

Edit the SVN configuration file (if you don’t know how to use vim, you can download this file and edit it using a text editor)

sudo vim /etc/apache2/mods-enabled/dav_svn.conf

Add this line to the end of the dav_svn.conf file

ScriptAlias /viewvc /usr/lib/cgi-bin/viewvc.cgi

Now edit the viewvc.conf file

sudo vim /etc/viewvc/viewvc.conf

Look for root_parents and uncomment this (remove # symbol), change the line to:

root_parents = /var/www : svn

Restart apache server

sudo /etc/init.d/apache2 restart

You can now access viewvc at:


Subversion (SVN) on Debian 6 32-bit for Dummies Tutorial

This tutorial has been only tested on Debian 6 32-bit, it should work on other operating systems. The tutorial assumes you are familiar with entering basic linux commands. You will need root access!

This tutorial was adapted from:

I will install the SVN repository at this location on my website:

Update Aptitude

sudo apt-get update

Install subversion if you haven’t already:

sudo apt-get install subversion

Install apache (this is your web server) if you haven’t already:

sudo apt-get install apache2

Install svn libraries for apache:

sudo apt-get install subversion libapache2-svn

I will now create the repository at this location /var/www/svn
This location can be reached on your internet browser at

mkdir /var/www/svn

Use svnadmin to create the repo at /var/www/svn

svnadmin create /var/www/svn

Verify this location with the following command, you should see: * Verified revision 0
svnadmin verify /var/www/svn

Now the hierarchy of the repo is create (i.e. branches/tags/trunk)
We will first go to your tmp (temporary) folder and create the structure there under a directory called svn

cd /tmp
mkdir svn
cd svn
mkdir branches
mkdir tags
mkdir trunk

The svn folder containing branches/tags/trunk is now imported to your svn repo created earlier at /vaw/www/svn
The ‘first import’ part is the comment for this revision.

svn import /tmp/svn file:///var/www/svn -m "first import"

Now we will password protect this directory so your svn repo is not public to the world. Replace username and password correspondingly.

htpasswd -cb /var/www/svn/htpasswd username password

This steps adds the subdomain to point to
You will need to know how to use vim in this step or you could use a ssh browser and download and edit this file…

cd /etc/apache2/
vim httpd.conf

Your httpd.conf file should look like this (remember to change

<pre>LoadModule dav_svn_module modules/
LoadModule authz_svn_module modules/
&lt;VirtualHost *:80&gt;
DocumentRoot /var/www/
<pre>&lt;VirtualHost *:80&gt;
        DocumentRoot /var/www/svn
        &lt;Directory /var/www/svn&gt;
                AllowOverride All
                Options MultiViews -Indexes Includes FollowSymlinks
                &lt;IfModule mod_access.c&gt;
                        Order allow,deny
                        Allow from all

        # WebDAV access
        &lt;Location /&gt;
                DAV svn
                SVNPath /var/www/svn
                AuthType Basic
                AuthName "Your message for this realm"
                AuthUserFile /var/www/svn/htpasswd
                Require valid-user

                # authentication
                &lt;LimitExcept GET PROPFIND OPTIONS REPORT&gt;
                        Require valid-user
Now we will restart your apache server for settings to take effect:
/etc/init.d/apache2 restart

If you followed all these steps then hopefully your svn repo should be setup. Test this by visiting
You should see revision 1!

To add additional users to access your repo:

htpasswd /var/www/svn/htpasswd username