The lead developer at Mosaic, Brighton with a passion for web application development and motorcycles.
When working in a team it is very useful to have a central web server with multiple environments and a configuration as close to the live server as possible. This can be a bit of a nightmare though if you need to setup a new VirtualHost container in Apache every time a new project is brought on or when a developer wants to work on a version of the site in their own environment.
The good news is that this can all be handled automatically and new sites can be setup by simply adding a new directory to the file system. There are at least two ways of getting this going; the first of which is the mod_vhost_alias module for Apache and the second is enabled via mod_rewrite. I prefer to use the second method as it is more flexible and it allows you tap into the ability of mod_rewrite to introduce environment variables and redirect requests (this is particularly useful for robots.txt - you’ll see).
The Apache2 Manual does have a very good page dedicated to overcoming this problem, but I will be sharing with you all the settings I am using which you will need to stop Google et. al. from crawling your sites served from the staging environment for example.
External Link: Getting gearman to install on Ubuntu
Getting the gearman PHP PECL package to build on Ubuntu is problematic with many unaccounted for dependency issues.
I only made a couple changes when following the instructions from JSJoy as I am running Karmic rather than Lucid I changed the apt-get sources to:
deb http://ppa.launchpad.net/gearman-developers/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/gearman-developers/ppa/ubuntu karmic main
My sources file was also located at /etc/apt/sources.list and not /etc/sources.list as stated in the original post from JSJoy.