Aspects of Developing With, and Using, Open Source Software


2. Open source as a development platform - LAMP

The open source application platform is based on four major components: The Linux operating system, the Apache web server, the MySQL database, and a scripting language whose names starts with the letter 'P' - Perl, PHP or Python depending on your taste.

Lets look at them in turn...

Linux is the best known of a family of open source operating systems which also includes the various BSDs and a number of hardened variants designed for security - even the USA's NSA contributed a secure variant of Linux. Both Linux and BSD are very reliable. There are also a number of embedded variants of Linux available, and an industry wide attempt to establish a standard for them is underway. If you want to get some idea of how widespread, I could cite an example which I spotted recently. It was a press release from a company called SpaceDev announcing a new high performance microsatellite product, which used a real time Linux operating system. This is far from a unique case.

To give you some idea of how reliable Linux is, I ran a Slackware version of Linux with the 1.2 kernel on a 66Mz 486 as an Internet gateway/firewall at home for four years without rebooting it. When it was finally taken down it was only because the hard drive and cooling fans wore out! Another example, the server for the Federation II game, has been running without a reset for just under two years now, and doesn't look like it will need resetting until I come to upgrade to a new version of the operating system.

Over the last few year the scalability of Linux has increased to keep pace with the multi-processor boxes now available fairly cheaply. I don't claim it is yet up to the level of the highly mature operating systems the big boys are using with hundreds of multi-core processors, but that will come with time.

Apache is a web server that traces its ancestry back to the original NCSA* web server - a version that was patched so often that it became nicknamed Apache. Since that day it has been rewritten and refined to enhance its modularity and reliability. As such it is the most widely deployed web server on the Internet. It's reliability is legendary.

I confess to being a bit ambivalent about Apache, because it is so big, and because it does so much. I just have a gut feeling that maybe it should be simpler, not more overreaching. Don't forget that more day to day security problems with web servers are caused by mis-configuration and wrong permissions than by anything else. The more complex the configuration that is needed, the more chance there is of a mistake.

However, the fact is that in spite of my misgivings, we use Apache, and it's never failed us yet in the seven or eight years we've been using it. I guess the proof of the pudding is in the eating :)

The 'M' stands for MySQL, an open source SQL database. This is a relatively late comer to the table. I wish it had been around when we moved off AOL and onto the Internet. The fact that at that time there wasn't a decent Linux based SQL database available meant we had to buy a commercial one - we chose Informix, which in retrospect wasn't the wisest choice. Because it didn't run on Linux, we had to buy a HP-UX D-series server to run it on. Then we needed to rent extra cabinet space to house the monster, and so on...

I'll be blunt. MySQL is not as sophisticated as, say Oracle, but then it's not been around for so long as Oracle has (and it also doesn't suffer from ultra-persistent salesdroids). If your application does need an SQL database, though, I would definitely look at it as a possibility. Try and match what MySQL can do to what your SQL database requirements are - you might be surprised to find out just how well MySQL could cover them.

SQL databases are not the only ones that applications use, of course. I've been using BerkeleyDB, an embedded open source database for several years now, and it's performed flawlessly.

And then there is the 'P'...

The 'P' is the scripting language used to bind everything together. This is an area where prejudices run wild - mine included. Everyone has their own favourite scripting language. The original 'P' was Perl. I confess that I'm not really enamoured of Perl - I have difficulty getting my head round a language made up entirely from punctuation marks :)

The next popular language to come along was PHP, which is more like a conventional language. PHP is widely used now. There was a security bug found not long ago, but as far as I'm aware, it's been fixed now. My personal preference for a scripting language is Python. That's probably not surprising, since I'm actually a C++/C# programmer, and those languages are very compatible with Python.

There are also many scripting languages that don't start start with the letter 'P' - Ruby, Bash Shell Script and even Rexx jump immediately to mind. Perhaps the best thing I can say is that there are a plethora of good scripting languages - pick one that fits in with your mind set!

As far as development goes there is the excellent GNU compiler collection and toolset. There are a myriad programmers' workbenches from eclipse through to emacs, which is as much a workbench as an editor. There are more libraries than there are brackets in a lisp program. And most of them are open source, so you can get hold of the source if you need to. As long as you have the source, it won't die!

Finally, in this section I'd just like to explain about distributions.

You don't go and buy a 'copy of Linux' from 'LinuxSoft'. The kernel that Linus wrote is only a small, though very important, part of what you need for a fully functioning Linux system. Instead there are companies - and groups of enthusiasts - who collect together everything you need and burn it onto CD or DVD together with a proper installation program.

The two best known distributors are Red Hat and SuSE, but within the open source movement others such as Debian and Ubantu have a good reputation. You can scour the web and put together your own flavour of Unix, but I wouldn't advise it - even a minimalist version of Linux runs into several thousand files!

There are a lot of things in flux about distributions at the moment, which makes it difficult to give specific advice. What I can tell you, though, is to only use the consumer editions as tools to play around with and gain confidence.

For production work invest in one of the 'enterprise' type distributions. It's not that the enterprise versions are 'better', it's because distributions like (say) SuSE professional get upgraded every six months, and SuSE stops supporting these versions with bug fixes after about 2 years. The enterprise editions, on the other hand are guaranteed to be supported for a lot longer.


*In the talk I incorrectly referred to this as the Mosaic server. In fact Mosaic was the NASC's web browser - the first ever graphic web browser. My thanks to those who pointed this out in the Lamb & Flag pub after the talk was over!


>> Next page >>


Back to the Phlogiston Blue top page


If you have any questions or comments about the articles on my web site, click here to send me email.