Exposing Subversion through Apache

This tutorial will guide you through exposing Subversion with the Apache HTTP Server on Ubuntu so that it can be accessed on a network. We will make use of the WebDAV protocol.

Before we start, you might want to check out:
Installing Subversion on Ubuntu
Installing Apache on Ubuntu

The first step is optional, but can assist you in identifying any errors that may happen through the process. Type the following at the terminal:

tail -f /var/log/apache2/error.log

This will display the Apache error log and will update and display the errors as they happen.

To enable Subversion to be used on the Apache server, you need to install the apache2-svn library which will also install the WebDAV protocol:

sudo apt-get install libapache2-svn

You will also need to add the Apache web user to the Subversion group:

sudo adduser www-data svn

In the previous command, ‘www-data’ is the Apache web user and ’svn’ is the group which has access to Subversion on the system.

Next we need to update the WebDAV protocol configuration. Enter the following at the terminal:

sudo gedit /etc/apache2/mods-available/dav_svn.conf

Uncomment the following lines:

<Location /svn>

DAV svn

SVNPath /var/lib/svn

AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd

Require valid-user

Now you need to edit the file to reflect the settings on your system. ‘SVNPath’ is the location of the Subversion home directory. In my case this should be changed to:

/home/svn

‘AuthUserFile’ should be changed to the location of your Subversion password file. We will create this file in the next step. In this case it will be:

/etc/subversion/passwd

Restart the server by entering the following at the terminal:

sudo /etc/init.d/apache2 restart

Next we will create the Subversion authentication file. This file contains user authentication details. If you have just installed Subversion, the password file will not yet exist and needs to be created using the ‘-c’ switch. Adding any users after that should be done without the ‘-c’ switch to avoid overwriting the password file. Enter the following at the terminal and enter your username in the ‘[username]’ field:

sudo htpasswd -c /etc/subversion/passwd [username]

You will be prompted for your password.

To add more users at a later stage, you can run the following command:

sudo htpasswd /etc/subversion/passwd [second_user_name]

To test that everything has been set up correctly, you can enter the following at the terminal:

svn info http://localhost/svn

This should display some information about your Subversion repository. You can now find the repository at the following location (enter this address in your browser to test):

http://localhost/svn/

Installing Apache on Ubuntu

This tutorial will take you through installing the Apache HTTP Server on Ubuntu.

Enter the following at the terminal:

sudo apt-get install apache2

This will install Apache to ‘/etc/apache2′ on your filesystem. The server will be automatically started each time you start Ubuntu. Alternatively, you can start, stop, and restart the server by running the following commands respectively:

sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 restart

The document root will be installed to ‘/var/www’. This is the root directory of the context path where your files can be accessed from on the server.

To test that it is working enter the following at the terminal:

sudo gedit /var/www/index.html

Enter the following and save it.

<html>
    <head></head>
    <body>
        Yeaa. It works!
    </body>
</html>

You can now open the browser and enter the following address:

http://localhost/

This should display the page you have just created.

Installing Subversion on Ubuntu

We all know how important it is to use version control even if you are working alone on a personal project at home. In this tutorial I will take you through installing Subversion on Ubuntu.

Installing Subversion on Ubuntu is extremely easy. To begin, enter the following at the terminal to update to the latest repositories:

sudo apt-get update

To start the installation enter the following at the terminal:

sudo apt-get install subversion

The first thing you need to do is to create a central repository where your files can be stored. I chose /home/svn. We will use the svnadmin tool which will create the path and also set up the repository:

sudo svnadmin create /home/svn

Next we need to create a group in order to enable access to the Subversion repository. Enter the following command at the terminal to create a group named ’svn’:

sudo addgroup svn

Now you can add yourself to this group:

sudo adduser your_username svn

You will also need to do this for every other user who will need access to the repository. After you have added yourself to the group, you will need to log out and log back in to ensure that you are registered as a member of the newly created group.

To enable access for the svn group to the repository we need to change the group and also set the permissions:

sudo chgrp -R svn /home/svn
sudo chmod -R g+rws /home/svn

And that’s it. You can now set up Subversion with your IDE or any other Subversion client. The repository can be located or accessed at the following two locations:

file:///home/svn
file://localhost/home/svn

You can test it by entering the following at the terminal:

svn info file:///home/svn

This should display some information about the repository.

Also note that this method will only allow local access. If you want to share the repository over a network, you will need to install Apache or some other server to expose the repository directory.

The Shuffle

Most of us spend most of our day interacting with computers. It is confusing then why we are still using such inappropriate ways to interact and communicate with them.

Throughout the day I find myself shuffling my right hand between the mouse and the keyboard. I touch-type, so I need to use both my hands. Click here, type something, click there, type again… All very frustrating! We really desperately need a new way for human computer interaction. We should start thinking of computers more as an entity you are communicating with than just another device to get your work done on.

At the moment most people use two mediums in which to communicate with computers - the keyboard and the mouse. This is terribly inefficient and a lot of time is wasted in shuffling between the keyboard and the mouse. But wait, don’t we communicate with each other in more than one medium as well? Yes we do, but the different ways, like body language and spoken language, complement each other and work together to help us to better understand each other. The keyboard-mouse thing does exactly the opposite, they interrupt each other. Think of this as starting a sentence in spoken language and then finishing it in sign language. Not a pretty picture is it? Then why do we communicate with computers in this way?

The problem does is not only with the hardware, but also with the software. Programs and websites are not currently being designed to enable optimal interaction. Surfing the web mostly consists of only using the mouse and then you have to fill in forms, log in by typing your username and password, etc. There are some projects, like the OpenID project and the auto-complete functions of browsers, which makes this more bearable. Is the problem that in trying to escape from paper we are still caught in the paper-based paradigm, designing ‘paper-based’ websites?

Because we interact with computers in mostly a visual manner it is necessary to have more than one medium, but we need to find ways for these mediums to work together without interrupting each other. Some possibilities may include using a left-hand mouse (if you are right-handed like me) and combining it with handwriting. Or using eye-tracking systems to move the pointer on screen while keeping your hands on the keyboard. Maybe the future is in natural language and voice recognition replacing the keyboard. It may even be as simple as designing a one-handed keyboard like the one the vilian had on his arm in one of the Bond films. It took me about two months to learn to touch-type at a reasonable speed - I would definitely take the time to become accustomed to a one-handed keyboard.

All of the above methods are hardware related and there are some really interesting developments in that field at the moment. For now we should consider designing interfaces which are more intuitive and easier to use. Users should be able to, without even thinking about it, find what they need without looking for it.

Remembering with Slash Recall Patterns

I have recently finished writing exams. I am studying part-time, so I did not have that much time to study as things at work is quite rough this time of year. I thought that I would try out a new technique I read about a while ago in Remember Everything You Read: The Evelyn Wood 7-Day Speed Reading & Learning Program.

The technique consists of drawing slash recall patterns of the material you need to study. The slash recall pattern consist of lines and branches to provide a summary of the material. This is especially useful for memorizing theory, but can also be expanded to break up formulas or steps into small elements which are easier to remember.

This technique is effective as (with most diagrams) it combines both sides of your brain. You use your creative side of the brain in drawing the diagram and the layout also stimulates the logical part of your brain. Also as you are designing your own diagram, it is easier to remember.

I was able to condense the material (which was mostly theory) from about 500 pages to about 15 pages of diagrams. I had one diagram for each chapter in my textbook and it covered more or less 70% of the material (I focused on the most important material and added some extra just to be sure). Having each chapter laid out visually before you, you have a good overview and can also better understand how the different components fit together.

The following diagram is an example of one I used for the first chapter of my Advanced Database Management course:

DB Slash Diagram

It is very quick to draw the diagram and also to redraw it until you can do it without thinking. Each branch represents a section of the material which can then branch out into subsections. You can make it as detailed as you want, but it is much easier to remember if you keep it as simple as possible.

In the exam situation, I scanned the paper to identify the required sections. Then I drew the diagrams for those sections. I spent about a third of my time just recalling and drawing the diagrams. Then when you have all the material right in front of you, answering the questions is almost trivial.

I found this technique extremely useful, not only in the amount of time it saved me in terms of studying, but also in remembering the material. I would certainly use it again. PS: I aced my exams!

« Previous PageNext Page »