I recently completed a migration from Windows to Linux for a few blogs and wiki - PerCS being one of them! What follows is a record of the process - from initial motivation, through migration and lights-on. If you are interested in a reality-based Linux v. Windows comparison, NFS exports, hardened Apache, or the latest in Drupal then by all means read on!
Motivation
I was hacked by script-fiends. I was pissed off that my hardened Windows server had been breached. As a small business owner I need a low-touch system - for me that means three things:
Hackers use tools such as Nikto to discover the security situation of a website. Even without such a tool the casual hacker would have discovered my private FTP site. And thus the challenge: get at whatever was on the site. The hack was a brute-force dictionary attack on username and password. It resulted in read access to some files on the server. Not the worst intrusion there is...but I was in their sights. Within hours every security hole was being poked to see if it was open. So I brought the site down while I examined my options. I know you're thinking, "FTP is insecure and should only be used for public data." Well as they say, here's the rub: I needed secure, reliable file transfer of some of my files. On Windows Server 2003 and prior you get one or the other, but not both. You get secure authentication over HTTPS (Integrated Security or certificate-mapped), but file-transfer is unreliable. You get reliable file-transfer over FTP, but authentication is insecure. The well-established SFTP is not part of Windows products - so I chose reliability over security.
During months prior to the hack I spent more time than I could afford: installing patches and monitoring intrusion attempts. Meanwhile Windows was still not meeting my security needs. The problem was simple: the Windows distribution is bloated. Installing so many services increases security risk. With Windows you start from an insecure state; to attain security you remove components, restrict settings, reduce privileges. This is a flawed model. Linux on the other hand starts with a minimal, secure state...and then you add components, settings, and privileges as needed. So why was I running Windows in the first place? Convenience. I got locked into a blogging engine and wiki software; not to mention a huge NTFS volume that I did not have time to migrate.
Once I started looking into replacement services (file server, blogger, wiki) I had another major motivation to migrate: Drupal. If you are not familiar with it then stop reading and go here - you won't be sorry. Drupal is an open-source CMS written in PHP with support for MySQL and PostgreSQL. Its highly modular design gives it both a lightweight footprint and tons of pluggable features. There is very little in the content-publishing space that Drupal cannot do. And while it does run fine on IIS - it runs even finer on Apache. But before getting to the new stuff let's finish up with the motivation. If you have never taken an old machine - say a Pentium III 450Mhz 256MB - and loaded Linux on it then you really should...if nothing else you will see how powerful the machine still is. All that amounts to that 90's buzzword: ROI. But the details are real:
RAM (base OS): Windows: 128MB; Linux: 32MB
RAM (w/ httpd): IIS: 384MB; Apache: 128MB
Processor (mean utilization): Windows: 35%; Linux: 7%
And there is more, from the deployment limitations of ASP.NET blog engines to interoperability lock-in. After a while you just have to ask, why bother? Which leads us to a migration from Windows to Linux that would go something like this:
| Windows Server 2003 | Gentoo Linux kernel 2.6.11-r11 | |
| NTFS 5 | Ext3 | |
| IIS 6 | Apache 2 | |
| DasBlog 1.6 | Drupal 4.6 | |
| FlexWiki 1.6 | Drupal 4.6 |
tar -czvf beagle.tar.gz /mnt/data /mnt/documents /mnt/music /mnt/video /mnt/source.emerge mod_php. For a fully automated ride I added to /etc/portage/package.use the following line: dev-php/mod_php mysql gd. When the emerge completed I had a working LAMP stack - albeit configured for non-production use.chown root && chgrp root && chmod 644). I created a document root for applanet at /exports/data/sites/com/applanet. Apache's mod_vhost is absolutely awesome. If you've only known IIS like me...then stop right now and check it out. I went with /exports/data/sites/%-1/%-2 for my multi-site needs.Lights-On Once the LAMP stack was setup I used test-driven development methodology from there on. As a result I was able deploy and test sites throughout the migration. I now have a sweet build script for all my sites. I will write about it shortly...but the point is that I knew when to go lights-on: when there were zero tests failing. So this post essentially marks the re-opening of PerCS. I have a great platform now for some of my ideas...and probably some of yours too!