More fun with the Webfusion configuration
- Mon 5th Dec 2011 1:20 AM
This is a follow-up to my article on building a Webfusion test VM. My aim is to create a test environment which reflects my Webfusion environment at a file system organisation and PHP programmatic level. The Webfusion service itself uses name-based dynamically configured mass virtual hosting that is more complex than the examples in this Apache technical note, and its implementation requires patches to the Apache build. (See below for more details). In my case, it is a lot simpler to stick to a standard Debian Apache configuration, with a virtual host for each site to be tested in the /etc/apache2/sites_available directory as in listing 1 below, as this removes the need to add rewrite rules in the <VirtualHost> section and works with an “out of the box” Apache install. Note that 192.168.1.245 is my static IP address for my VM and this would need updating for another installation. With this configuration, I now have full access to the error and rewrite logs and can now fully debug my applications locally.
The last thing that I need to do is to set up my D/B account (either in phpMyAdmin or by executing the following from the MySQL root account, with the database name, username and password as appropriate):
CREATE DATABASE dddddddddddddd CHARACTER SET utf8; CREATE USER 'uuuuuuuuuuuuuu'@'localhost' IDENTIFIED BY 'pppppppppppppp'; GRANT ALL ON dddddddddddddd.* TO 'uuuuuuuuuuuuuu'@'localhost';
Creating a test VM to mirror the Webfusion Shared Service
- Tue 29th Nov 2011 23:02 PM
In previous articles I have discussed how difficult it is for users of a shared web hosting service such as Webfusion's to develop and to debug applications on a service that they're using to provide services such as a blog or a forum to a client community over the web. In my view, there are two main challenges to developing on such 'production' environments:
-
The supplier of the hosting service will typically optimise the service for normal access – that is for live use – and this usually involves disabling all debug features and diagnostics.
-
The development process can temporarily 'break' functional code or introduce bugs. You will normally want to keep the existing service running in parallel to this development without its failing.
For these reasons, mature IT organisations invariably separate out development from live 'production' and use multiple environments for development teams, pre-production testing, user trials, production itself and support. Not doing this is asking for trouble and is just bad practice, so I use VMs hosted either on my laptop or on my home Ubuntu server to do all such testing. I find that a standard Ubuntu LAMP stack (such as on my laptop) is good enough for functional development. However this type of LAMP stack is different in subtle but important ways from the Webfusion shared service architecture, so I have also set up a VM configuration which far more closely mirrors the Webfusion set-up.
Oh, the embarrassment!
- Fri 25th Nov 2011 0:35 AM
I’ve just discovered a bug in my blog: any comment posts get thrown into the bit-bucket and are never passed to me for acceptance / publishing if the user making the comment is a guest (that is not a blog author) and accessing the public instance on my blog.ellisons.org.uk domain rather than my private and locally installed development system.
I can only plea in mitigation is that this combination made it easier to miss this bug in my module and integration tests. I did a quick check on my access logs (I've got the last 18 months archived), and I've work out how many comment posts were made in this period – roughly 4 a week. If I ignore the 21 spammer probes that were 404'ed, there were a total of 295 reader comments. The comments themselves are gone forever, but appended an article league table for comments, with a cut at 5 comments. My sincere apologies to all these blog readers, and I really regret losing this valuable feedback.
There were a couple of factors that helped my missing this. The first is that I decided to do a complete reimplementation of the blog engine based on some of the conclusions that I've come to in these articles on PHP performance, and I've been working on that on my development system. The second is that I had some heavy commitments in apache.org that took most of my spare time for a couple of months. Both of these will be the subject of future articles. However, I first needed to fix this bug before I could publish this article from my test system to live – otherwise I would have whithered with shame! More ... >>>
More on using Rewrite rules in .htaccess files
- Mon 21st Nov 2011 16:58 PM
This article is a further discussion how to use rewrite rules on a shared hosting service (SHS) such as the one supplied by Webfusion and that I use. It develops some earlier discussions in the following blog articles: