This site, formerly known as ‘zebpedersen.co.uk’, has undertaken its third official server move. Since the first post on Sept. 15th, 2010, the site has inhabited Uncle Meat – an HP DL380 G3 which was loud as hell, Lumpy Gravy – a homebuilt PC which was much more civilised, and most recently Phaze III – a rented VPS on a 200 meg pipe (up from the 512k home broadband the original machines ran on).

That server grew to be slow as hell, and I’m serving more professional content now which means uptime is important, and the old box wasn’t cutting it, and was expensive. And thus we arrive at today – the old site, reborn on a new, faster, more reliable, cheaper server (named Thing-Fish), and with a new domain to boot. The original zebpedersen.co.uk will soon redirect to the new zebpedersen.com, my portfolio site, so update bookmarks etc… to the somewhat new zeblog.co.

I was contacted a couple of days back by a reader who wanted to add my super simple WordPress backup program to Cron, the Unix task scheduler, to create automated regular snapshots of his site. Backing up my website using the program is something I normally do by hand as part of my general system maintenance routine, but the program is easily incorporated in to Cron to run on a timer. Completely by coincidence, I suffered a WordPress plugin failure within a couple of days of creating the Cron job, and thanks to my now daily backups I was able to restore from a 10 hour old snapshot with the minimum of fuss. (more…)

Whatever you do with your computer, it’s absolutely vital to back up your data. Never is this more true than when you’re administering a website, where creating backups should be a well organised and regular procedure.

This site is no exception to that rule, so to help me out with my daily backups I’ve written a small program in the Python programming language which automates the process of archiving daily snapshots of my site. For peace of mind, I still prefer to launch and organise backups myself rather than use completely automatic solutions; this program helps make that process much quicker.

Download

If you want to download straight to your Linux machine from the command line, use wget:

$ wget http://zebpedersen.co.uk/python/wordpressbackup

The program is designed to run under Linux, but theoretically it will work on any Unix system (Mac OS X, Solaris etc…) with Python installed.

Operation

All you need to feed the program is the path to your WordPress installation (the directory containing your wp-****.php files). The database login credentials are borrowed from WordPress, and the backup is placed in a date-stamped folder for easy archiving.

Each backup contains a dump of your MySQL database and a tarball of your installation directory – everything you need to restore your site in case of a disaster. The backup will be created in the folder from which you start the program.

To launch the program:

$ ./wordpressbackup /path/to/wordpress/installation

For example, if your site is located in the directory ‘/home/randymarsh/web’, the command would be:

$ ./wordpressbackup /home/randymarsh/web

If you need help or more information, use the help & about functions:

$ ./wordpressbackup help

$ ./wordpressbackup about

Hopefully this little script can help out anyone else like me who only trusts a backup they’ve done by hand. Enjoy!

A short post which might save you an hour or so banging your head against your computer screen.

I’ve been setting up another site using indexhibit for a CMS – it’s a pretty standard installation, using PHP, Apache2 and MySQL. Database creation is identical to WordPress and setting up the system is simple – however once everything appeared to be working, I hit a really really frustrating and fundamentally crippling problem.

The Problem: Unable to upload pictures to exhibits

Pictures upload to the server, but the CMS does not ‘see’ them – you don’t get thumbnails, you don’t get the option to upload more images, you can’t use them in your exhibit. Basically, this renders the whole site useless.

The Solution:

Install GD. GD is a PHP extension which is used to process uploaded images – you can read more here, should you so desire.

To install, type the following at the command prompt:

$ sudo apt-get install php5-gd

Usual apt installation process will occur ( After this operation, 602kB of additional disk space will be used.Do you want to continue [Y/n]? ), and after that you can restart Apache – it will reload the config files as part of the install, but I’d rather be safe than sorry.

As detailed elsewhere on the site, I’ve recently replaced my server, which has meant migrating my site and it’s associated bits and pieces from old to new. Here’s a handy ‘all-in-one-place’ guide for migrating a WordPress-powered site from one server to another with the minimum of hassle.

[If you have a basic WordPress configuration, this guide will get you up and running quickly and easily. For more complex configurations, you will probably need to do some more research after reading this]

MySQL

Your WordPress site is linked in with and heavily reliant on a MySQL database for its operation, and the first port of call is to copy this database to the new machine. This, of course, means that your new system needs to have MySQL installed – Ubuntu Server gives you the option to install LAMP server packages (Linux/Apache/MySQL/PHP) in its setup process, but they are all freely available online if you haven’t already got them installed.

In order to copy your database, we need to dump it to a file and transfer it to the new machine.

Using mysqldump

For this stage, you need to know your MySQL login details. If you don’t remember them, they’ll be right at the top of your existing ‘wp-config.php’ file in the root of your WordPress installation. (more…)

Welcome to Lumpy Gravy indeed. The site appears no different today than yesterday, but behind the scenes it’s a whole different story.

After 6+ months of good service, Uncle Meat, the HP DL380 which has hosted this site since October of 2010, has been replaced. Running a system which was designed to (and formerly did) occupy a corporate datacenter in your home sadly proved impossibly noisy, and Uncle Meat was moved to the garden shed shortly after coming online.

This was actually a pretty decent (if hacky) solution – the shed was freezing cold all winter and noone went outside because of the unfriendly weather. However, things in Sussex have taken a turn for the lovely, and with temperatures outside approaching 30 degrees, Uncle Meat has met a couple of issues which have precluded its continued employment.

This DL380 sports a pair of 2.80GHz Xeons, which are great for number crunching but, because of their NetBurst architecture, kick out a phenomenal amount of heat. Because of this, running 24/7 in 30 degree plus heat (even with the window open) is not the most reliable environment, and a far cry from the air conditioned datacenter it formerly called home. The noise of the cooling array is what evicted it from the house originally, and with more time being spent in the garden it’s no longer an okay place for Uncle Meat to be.

It’s been great fun learning the ropes on this machine, but life must continue and this site now has a newer, quieter and faster home – introducing Lumpy Gravy.

Lumpy Gravy is a decent step up in specification despite coming into existence on a shoestring budget, and it’s been designed with practicality in mind from the outset. Specs are as follows:

Intel Core 2 Duo E6600 (2.40GHz, 4MB L2)

ASUS P5KPL-AM

2GB Corsair XMS2 DDR2

500GB Western Digital Caviar Green HDD

Ubuntu 10.10 64-bit

The Core 2 CPU is a decent amount quicker than the pair of Xeons it replaces, and has much better energy saving features. It’s running at a cool 30 degrees using only the stock Intel cooler, spinning at just 850rpm (= quiet!).

Even though this is definitely a system on a budget, I went for decent quality RAM – Corsair XMS is designed for overclockers and both DIMMs have heatsinks on either side. Because I’m not overclocking, this should be a really stable solution (it’s always very reassuring to be working with components well within their tolerances). I’ve been building with ASUS boards since the late 90s and they’ve never given me any reason to change allegiance. This one has really nice square VRMs which are designed to fit perfectly with the outer fins of the CPU cooler – a neat touch which helps with heat dissipation and should keep this rig stable. It’s running a G31 chipset, with a minimal 8MB RAM shared with the integrated GMA 3100.

Western Digital is another brand I’ve used almost exclusively for over a decade now, and their current range of Caviar drives is very well thought out, providing clear options depending on the system builder’s priorities. In this case, my priorities were minimal power consumption, quiet operation and long term reliability. The Caviar Green was the obvious choice for me – it spins at 5400RPM (quieter, longer life) but has 32MB of cache memory, ideal for a web server.

I’ve also taken this opportunity to upgrade Ubuntu to the latest and greatest – 10.10 in 64-bit. Yes, I’m only running 2GB RAM, but this gives the opportunity to upgrade past 4GB in the future, as well as the (occasionally noticeable) performance benefits of running 64-bit software.

So that’s Lumpy Gravy, the new home of zebpedersen.co.uk and my associated ‘cloudy’ bits and pieces. I’m currently working on a handy guide for anyone porting a WordPress site from one machine to another, and there’s some exciting new configurations I’m working on with Apache 2 which will be written about shortly as well.