Fixing case sensitive problems when moving a site from Microsoft to Linux

May 16th, 2008

As a lot of people will have found when building a site on a Microsoft machine and transferring it to a Linux server case sensitivity problems occur. For example an index.html file called Index.html or images in a folder called Images but links reference the folder name as images. This causes 403 errors and missing images and css. I have come across this a couple of times on small sites and have always fixed it manually. However a site came to my attention yesterday that had this problem and I could not be bothered to rename all files and correct all links manually. Instead I wrote a script that recursively renames all files to be lowercase and look for anything that looks like a link to a file within the files and lowercase the links as well. It worked perfectly for the site in question and I thought perhaps other people may find it useful so here it is.

http://homecluster.co.uk/perl/lowercase-site.txt

Just save it to your sites main directory and from there execute it. It may need a few file extensions adding to the regex I only added the ones that I needed.

Change

January 27th, 2008

Well the data centre loft project is on hold for various reasons so I thought I would update this blog with information of other things I am working on.

My latest project is writing a perl module for sending email via smtp using authentication. A copy of the first draft attempt is avaliable at
http://homecluster.co.uk/perl/SMTP.pm

It can be used to send an email from a perl script as shown below

use SMTP;
my $e = new SMTP;
$e->connection(”mail.foo.com”,”noreply\@foo.com”,”password”);
$e->email(”fromaddress”,”toaddress”,”subject”,”message body”);
The default authentication type is CRAM-MD5 however it will support PLAIN and LOGIN. The authentication type can be selected in the connection settings.
e.g.

$e->connection(”mail.foo.com”,”noreply\@foo.com”,”password”,”PLAIN”);

Warning: If you choose to use this code please note that the module does not currently do any checks on the data that it is being passed so the script calling it should vaildate any user input.

Why?

June 25th, 2007

The purpose of this blog is to document the creation of a small web hosting cluster in my loft. There are a series of technical challenges to overcome before this becomes a reality including, cost, equipment, software(both installing and creating), and my fiancée. The cluster will be made up of web servers, an email server, database servers, nameservers, NAS units, an ftp server all with two network interfaces one for external traffic and another for heartbeat error detection and automatic redundancy.

I bet you are asking “Why would I want to do this?”. Thats a good question the reason for this project is to learn the ins and outs of all the technology involved in a web hosting network and build experience in system administration.