Backup Server Slow Down

Recently I noticed that my backup server was slowing down. Doing system checks told me that it wasn’t running out of memory, nor was the CPU being highly utilised. It was only when I went into the server room and noticed that the hard drive activity light was persistently on that I realised what was causing the slow down.

I ran iotop and analysed what process was continually writing to the disk. I noticed this process was updatedb.mlocate. This is the Ubuntu indexing process, which goes through all the files indexing them to make searching much quicker. As this backup server uses backuppc and has years worth of backups, it has many thousands of files to be indexed and meant that updatedb.mlocate (which is run daily) was taking longer than 24 hours to index.

To solve this problem I edited the file /etc/updatedb.conf and added the backuppc directory to the line that tells updatedb.mlocate not to index files within a certain path. This is simply done by adding “/var/lib/backuppc” to the end of the line that starts off with “PRUNEPATHS=”.

So mine now reads: PRUNEPATHS=”/tmp /var/spool /media /var/lib/backuppc”

RIP Internet Explorer 6

The time I never thought I’d see is now on the horizon. The web moving away from supporting Internet Explorer 6.

Many web developers are all too aware of the pain of getting their websites working correctly in all web browsers and THEN having to make sure they work in IE6. This is not only inconvenient and irritating, but expensive. However, with Google announcing it is no longer supporting IE6 and now Amazon following their lead, it is appearing that very soon (not immediately) people will be forced to update/change their web browser to use these large and prominent websites. Many other sites have also dropped IE6 support (list at http://idroppedie6.com/).

Finally we will be able to spend our time on functionality rather than legacy support.

Define: “Computer Scientist”

I was in a meeting the other day, and something cropped up which was cause for much debate. This was attempting to define exactly what a “Computer Scientist” is. This is of course very relevant to the BSc (hons) Computer Science degree programme.

The question is: What skills should a graduate of this discipline have at his/her disposal? It’s all well and good saying “a bit of everything to do with computing”, but in practice an approach like that is very hard. How do you balance? Is there a bias? If I refer back to my Breadth Vs Depth post, I am talking about programming in specific. However, there is a lot more to “computer science” than just programming.

The “Science” part of “computer science” suggests that this is far more analytical than, say, a “software engineer” which is more development orientated. That is not to say that a “computer scientist” shouldn’t be a capable “software engineer” and vice versa. Are these two disciplines blurring? What industry should a computer scientist go into, rather than a software engineer?

Comments on a postcard please!

suPHP + Userdir on Ubuntu

Recently I’ve had the need to combine suPHP with the userdir mod for Apache on Ubuntu. By default they don’t play nice together. So here is a quick guide on how to get it working.

If you have installed a standard LAMP server (there are many guides on how to do this), you now need to install the suphp package for apache, this is called libapache2-mod-suphp:

$ sudo apt-get install libapache2-mod-suphp

Once that has been installed open the file /etc/suphp/suphp.conf in your favourite text editor. Find the line that has the docroot on, and change the docroot so that it is just “/”. This means that the suphp engine will parse anywhere in the file system, and not just in the standard html directory, thus allowing users to have their own.

docroot=/

You may also want to change the security options as appropriate, just change the “false” to “true” of the applicable ones the enable them. This is worth experimenting with. Further down you will want to set the “check_vhost_docroot” is set to false, this again is to do with the fact that userdirs are not in the vhost’s document root.

check_vhost_docroot=false

Finally you have the min_uid and min_gid properties. These are worth altering if you still want to be able to have a website running as www-data (such as the default website). If this is the case, change them both to the uid and gid of www-data (33 by default). It is not recommended to allow suphp to run as root, so do not set it to 0.

min_uid=33
min_gid=33

Finally, you need to enable the mods suphp and userdir, and disable the mod php5, this is done with two commands, and then restart apache2:

sudo a2dismod php5
sudo a2enmod userdir suphp
sudo /etc/init.d/apache2 restart

This should then allow you to run php scripts as the user who created them. To test this, create a new php file that contains:

<?php
system(id);

This will give you information of the user that the php process is running as. I recommend changing the ownership and retrying it, just make sure sure suphp is running as it should be.