This is for the gritty details of how the website works.
My website uses a "LAMP" solution stack of free, open source software, for a given value of "LAMP".
- The L is for Linux (CentOS 5.4); this represents the operating system for the web server.
- I use Apache for the back end webserver, with nginx as the front end webserver.
- A traditional implementation of LAMP uses MySql as the database engine. I chose PostgreSQL instead; my research led me to understand that it is a far better database.
- Many LAMP implementations use PHP as the programming language, but not all; there's Perl and Python (not to mention Ruby and Java).
This site uses Django, a web framework written in Python, for pretty much everything. Why?
- I like writing in Python, and Django programming is Python programming. There are other Pythonic web frameworks, but Django is the most feature-rich and mature of the lot. But those aren't the only reasons.
- At the beginning, I decided to use one application framework for everything. It had been several years since I did web programming, and I wanted to get back to speed as quickly as possible. I thought it better to concentrate on one framework than to toy around with several different frameworks. By implementing my ideas in one framework, I would learn how to use it properly - and to be honest, I don't have the time to experiment with multiple frameworks. So why not go with the best?
- There were times when I looked at the architechture of Django, and was impressed at its underlying design. For example, the framework uses a Model-View-Controller paradigm, although some documenters prefer to express it as "Model-Template-View". The database schema models are written in one place, HTML templates go somewhere else; both are independent from the URL scheme the web designer wants to use. I should add that the database models, which are python classes, are also decoupled from database engines; there's nothing preventing me from replacing PostGreSQL with MySQL, or SQLite, or even Oracle. This is a good thing. Loose coupling gives me freedom to experiment with one component without worrying about "breaking" something else. In addition, I'm not forced into producing crufty URLs.
- Finally, I appreciate how the designers have given a lot of thought to security. The modelling part of the Django framework generates all the raw SQL for me, and auto-escapes input unless not asked. This protects against SQL injection attacks.
These points are also reasons why I decided not to use PHP. It's easy to write PHP applications, but it's harder to write clean, SQL-injection free PHP. I don't have any objection to learning the language, but not right now. So there are no PHP applications here - not even pre-fabricated ones like Wordpress. (I wanted to roll-my-own anyway, and as someone said, "Building your own blog in django is kind of a rite-of-passage".)
One drawback with Django is that there weren't that many cheap hosting services that supported it in 2009, or even in 2011. But they do exist, and Djangofriendly lists them in decreasing order of customer satisfaction. The company with the highest number of votes was WebFaction, so I chose them to host this site. It's not just that prices were that low from an Australian perspective; it's that WebFaction permits a lot of flexibility for such a low figure. There's Ruby and Python and Perl and PHP; both MySQL and PostGreSQL are provided, and you can assign multiple domains and email adresses. Down here, $9.50 US a month would generally get you a couple of 100MB of memory, and a single MySQL database if you're lucky.
If you want to know more about how WebFaction pulls this off, and have 30 minutes to spare, I suggest you watch Learning Hosting Best-Practices From WebFaction. It appears I chose wisely with this outfit. The most interesting thing is how they use both standard Unix chmod permissions and NT-like access control lists to allow multiple users to coexist on the same box. I am very impressed indeed.
The latest change to this website is to use Blueprint Cascading StyleSheet framework for layout. The original CSS files were full of cruft and waste; it was cleaner to import Blueprint, and then rollover only the tweaks I wanted and no more. The result is that the width of the page has gone from 800 pixels to 950 pixels, and the text is now a lot bigger, but the colour scheme remains.
I've been using the same development machine for the last two years, but I've changed my development environment. When I started my website, I used WinXP SP3 for the OS. Due to disenchantment with the anti-viral software I was running, and the way it slowed down my machine, I switched to Ubuntu. I'm typing this page on it.
All domains associated with this site ("downandoutofsaigon.net" and "pkmurphy.com.au") are registered through MelbourneIT.