Apache Web server: Too many levels of symbolic links

After having this error presented to myself recently I thought it would be handy to let others know what it means!

So you’ve tried to restart/reload/start Apache on your Linux box and the following error has come up:

Too many levels of symbolic links

This is caused by one or more of the symlinks in the sites-enabled dir linking to its-self (maybe not directly but eventually ends up there :-(). I had my created my symlink using the command:

 ln -s <target> <destination>

But when I created the symlink my working directory was the same location as the file I wanted to link to, so I just typed:

ln -s somefile /var/somedir/somefile_link

Turns out this does not quite do as I had expected. (although not sure why)

The Solution

Basically the answer is to delete the symbolic link and start again this time using full path name, then is should all work:

ln -s /etc/apache2/sites-available/somefile /var/somedir/somefile_link

Missile Command (Java Applet)

I couple of years ago I decided it would be good idea to learn Java. Then after finishing my book Java in 24 Hours – good book by the way, I decided to try out my new Java skills, and what better way than with a game! The first game that sprang to mind was the old favourite missile command, a weekend later and I had myself a missile command game.

Screen shot of Missile Command, click the link below to play!

I knocked up a webpage and a high score system for it and ran it on a test server and only gave a few friends access to have ago. But here we are a few years on and I found my old missile command game, so I thought to myself lets put that on my new shiny blog (and obviosuly test it a few times to make sure it still works 🙂 )… So here it is with high scores and all:

Missile Command – Java Applet

I haven’t bothered (yet!!!) to change the look of the page(s) or the images or anything from it’s orginal design. But that may yet change 🙂

Comparing preg_replace and str_ireplace (Rude Word(s) Filter)

Filtering users input is unfortunately something that needs to be done these days. Possibly even more so when the content is coming from another website/service (such as twitter or facebook).  Swearing/rude words is quite a serious area, as you really don’t want to offend any visitors to your site by displaying a live thread showing comment or a ‘tweet’ or similar containing offensive langauge (tends to go down badly). So on this very note I set out today to add a live twitter feed to my current project (www.wsaf.co.uk), but decided once I had pulled the data from twitter I should probably remove any swearing before displaying it on the site!

As the site is written in php funnily enough this was also going to be. As I like to make my code as fast a possible I decided I would test the speed to different functions that could be used for this purpose:

preg_replace();
//and...
str_ireplace();

Continue reading

Latest Project!

So my current web dev related project is the 2010 WSAF website (Warwick Student Arts Festival – Massive student run arts festival, music, comedy, theatre, so name it. It’s there!) I did the site last year and I got the impression they quite liked it (http://old.wsaf.org.uk). So the new exec for WSAF this year asked me to do it again… Allbeit with some help this time around.

http://www.wsaf.co.uk

This year I have two computer science students to help out with the coding and two people who are very good at graphics to help with making the site look amazing! So all in all should turn out looking really really nice.