Archive for ◊ 2010 ◊

Apache and PHP on Snow Leopard
Wednesday, December 29th, 2010 | Author:

Yes, I have a new Mac. There may be fewer Ubuntu posts for a while.

To get Apache and PHP going for the first time, the following files need changing:

  • /etc/hosts
  • /etc/apache2/httpd.conf
  • /etc/apache2/extra/httpd-vhosts.conf
  • /etc/apache2/users/<username>

To create a new virtual host, the following files need changing:

  • /etc/hosts
  • /etc/apache2/extra/httpd-vhosts.conf
  • /etc/apache2/users/<username>

There are more details here:

I just know I’ll forget about that last file if I don’t record it here.

Category: Web Development  | Tags: , , , ,  | Leave a Comment

I discovered that any directory I created on a vfat file system in Linux whose name consisted solely of uppercase letters, and was 8 characters or less in length, was being converted to a lowercase name.
This was causing problems of J2EE war files being created containing both directories “WEB-INF” and “web-inf”.

The fix was to add the shortname=winnt option to the file system mapping in /etc/fstab, and then reboot.

So the line in /etc/fstab would be, for example:

UUID=483E-D7D6 /data vfat shortname=winnt,utf8,umask=000,gid=100,uid=1000 0 1



After turning my application running under SpringSource Tool Suite into a web app, then trying to run pre-existing junit tests, I started getting the error:

Plug-in org.maven.ide.eclipse.jdt was unable to load class org.maven.ide.eclipse.jdt.internal.launch.MavenRuntimeClasspathProvider.

An error occurred while automatically activating bundle org.maven.ide.eclipse.jdt (810).

The fix was to delete all the existing Run configurations (Run As / Run Configurations… / select m2 custom Run Configurations and delete them).
Restart STS (may not be necessary), and it now works!

Tips for Successful Corporate Blogging
Sunday, March 21st, 2010 | Author:

A recent boagworld podcast contained a segment on “Why corporate blogs fail”.  I’m going to summarise the content here, but the podcast itself contains loads of useful extra information and asides if you want more detail.  Most of it applies to any blog, not just organisational ones, and there’s a lot here I can learn from.

What Paul (Boag) said was that the most common reason for corporate blogs to fail was very simple: people stop blogging.  They stop blogging partly because it takes time to build a following and people give up too soon, and they also stop because blogging is hard.  It takes time to blog and it takes time to think of ideas.

But why blog in the first place?  Here are some reasons:

  • It improves your search engine visibility.
  • It attracts users to your site.
  • It results in increased links to your site.
Some principles to bear in mind when blogging:
  • Not all posts need to be long posts.
  • Keep a list of blog ideas wherever you are, rather than sitting at a computer hoping for inspiration to strike.
  • Vary the type of blog post (see below).
  • A post doesn’t have to be perfectly written.
  • Don’t assume that if you know something, everyone else does too.
Some possible types of blog post:
  • Ask a question
  • Cover an event, with a preview or review
  • A commentary (i.e. a response to someone else’s blog or article)
  • News in your sector, not just in your own organisation
  • An interview, possibly posting it in video or audio form
  • A case study, focussing on how a problem was solved, rather than self-congratulation
  • A review of a book, a service, or anything else
  • Hints and tips
  • A tutorial, include video, imagery, etc. if possible
  • Lists, e.g. a “top ten” list – easy to digest and popular
  • Resources, i.e. links to interesting articles
  • Predictions, can make you look like a visionary!
  • Debates, i.e. put forward someone else’s point of view, even if (or especially if) you don’t agree with it.
Yes, all useful stuff, and a reminder to me to do more than just hints and tips!
Category: Marketing  | Tags: , ,  | Leave a Comment
SpringSource Tool Suite Buttons
Tuesday, February 23rd, 2010 | Author:

After installing SpringSource Tool Suite 2.3.0 on Ubuntu 9.10, various IDE buttons were not working. The fix is to set the right value for GDK_NATIVE_WINDOWS before running it, e.g. have a file in /usr/bin that looks something like:

#!/bin/sh
export GDK_NATIVE_WINDOWS=1
/usr/lib/springsource/sts-2.3.0.RELEASE/STS

That’s it for now.

Upgrade Rails Database in Production Environment
Tuesday, February 16th, 2010 | Author:

To upgrade a database which is not in the development environment, use the RAILS_ENV parameter to rake db:migrate.

For example:
$ rake db:migrate RAILS_ENV="production" VERSION=9