Saturday, September 08, 2007

So many versions, so much confusion

How many times have you worked on a project or document only to
accidentally delete a critical file, made a modification and wished you
had the original copy, or simply keep track of all the changes to your
project. The most common way is to create an exact copy before doing any changes. It works, but it takes up unnecessary space and unless you keep a good listing of your changes, you'll be scratching your head wondering where to begin.

Obviously there is a solution for this, otherwise it'd be pointless to
write this entry now wouldn't it:P The solution is pretty simple
actually. Install a version control software :D And yes it IS easy to
set up as it sounds. It's the using it that's slightly confusing, but
I'll address it in a later post. For those who don't know what version
control is, check out this Wikipedia article.

This HOW-TO is based on thw howto from this site. I DO NOT take credit for this work and I'd like to express my appreciation to all the people who made possible. I'll be using the client/server version for this guide. It is also possible to set one up to be accessible via web but I'm not going to touch it here. The HOW-TO for that is already available.

On Ubuntu (regardless of version), follow the following step-by-step to
get your version control software up and running :-
  1. Install the necessary software needed.

    • sudo apt-get install subversion subversion-tools xinetd

  2. Create a user and group that will be have read/write access to the repository directory.

    • sudo adduser --system --no-create-home --home /var/svn --group --disabled-login svn

  3. Create the directory where the repositories will reside (your projects/documents)

    • mkdir /opt/svn
    • chown -R svn:svn /opt/svn

  4. Lets make the software listen on its own connection port.

    1. vi /etc/xinetd.conf/svnserve

      • add the following to the above file

      • service svn
        port = 3690
        socket_type = stream
        protocol = tcp
        wait = no
        user = svn
        server = /usr/bin/svnserve
        server_args = -i -r /var/svn
      • quit and save the contents. This makes our svn server listen to TCP connections on port 3690.

    2. vi /etc/services

      • Check if there is an entry similar to "svn 3690/tcp subversion # Subversion protocol". If you changed the port to something else, make the changes appropriately.
      • If it doesn't exist, add it in, otherwise just quit.
      • Note : If the above entry doesn't exist in /etc/services, the svn will not start.

    3. /etc/init.d/xinetd restart

    4. Check if our svn server is now listening on our
      designated port.

      • netstat -tuanp | grep 3690

And that's all there is to it. Now you have your very own version
control software ready to use. My next post will cover creating and
managing your repository.

I'm also thinking on how to make this also useful for incremental backups. Until then, stay sharp and lets support Open/Free software :D.

No comments: