What you will get from this article

This article is not a step by step instruction on how to setup a web server on a dedicated machine but rather a big picture of the why and how you would do it so that you can make an educated decision on what is needed in terms of time, skill, knowledge and what you can expect once the system is setup and running. So let's get into what were my own reasons for taking this path.

A little bit of history on my own web server

When I quit my last employment and decided that I had enough slavery (google robert kiyosaki) I went into the only business I knew how to run properly and that was anything related to web servers and web sites and portals with a touch of marketing. It's a potent mix if you ask me. However, starting off with no savings I had to sell my old BMW 525 1992 with LPG in order to sustain my self during the first half year of the endeavor.

Having no real money to invest I needed a low cost solution for web hosting. How many of you could figure this one out with no help at all? Good. Keep reading. Instead of opting for some VPS or shared hosting I decided I wanted a cheap dedicated server that I could tune to the last dot to perform as good as possible for my web development needs. That meant optimizing the machine to be as good as possible at Apache2/PHP/MySQL and specifically optimized for the TYPO3 CMS.

I can't really recall exactly how I reached NetDirekt, but I do recall that my conclusion was: cheap dedicated machines at the cost of me having to do all the work of getting it up and running. My first machine of choice was an old Pentium III at 800MHz with 10GB disk. Yup, you read that right. You might be thinking that machine is way to weak to compete with anything out there on the web today. And you would be wrong. I ran several speed tests against some of the most prominent web sites out there, as well as against a lot of competing web agencies in Croatia. Results? I actually scored in the top 10%.

So what was the secret? My machine was almost load free, insanely well tuned, and my TYPO3 expertise is at it's peak allowing me to configure some sick static file caching. This setup was enough to allow me to have a working CMS solution that functions at the speed of static file serving, which is way faster than anything that loads the PHP module in Apache. If this does not get you horny you better leave right now.

The setup of the server

Debian logoMy OS of choice is Debian GNU/Linux. It's packaging system is just sick. You can start from bare metal and have a running web server machine in a matter of a few hours. And this is exactly what I did. The machine that NetDirekt leased to me came pre-installed with Debian so what I basically did at first was to convert it to speak English, because at first it was speaking German. After the machine learned to speak English I installed the bare necessities: Apache2, MySQL, PHP, Dovecot, Exim4, SpamAssassin, SquirrelMail, PHPMyAdmin, PowerDNS and a few more helper utils and my machine was up and running.

I went to great lengths to deinstall absolutely everything that was not needed for serving web sites. This included any development tools such as the compiler, assembler and similar, anything related to X Window system and anything that could be a security risk. At the moment of writing this document my server has only 392 installed packages and all are from stable release. For those of you who want to get a precise list of the packages installed on this trimmed machine you can check it out right here: full list of installed packages.

One of the things I did to save memory was to run SSH daemon from inetd which served me two very useful purposes. Number one it saves memory, which was pretty crucial on a machine with only 256MB RAM. The other was that due to the fact SSH was loading each time I tried to connect it had a significant delay before showing up a user name prompt. This was a completely useful side effect that would prevent anyone attempting to brute force SSH login.

Apache2, MySQL and PHP were installed in a pretty much standard fashion but Exim4 was setup to work with a MySQL database for user credentials and have intergrated virus and spam filtering. This enables me to quickly administer my email system using a VExim web interface. You can find a full guide on how to do this in this article: Exim4 + ClamAV + SpamAssassin + Greylistd on Debian etch mini-HOWTO.

One of the last things I added to the machine, admittedly, now a little crammed, was PowerDNS. PowerDNS also uses MySQL as a backend and has a nice web interface so now I am able to control all of the crucial system features that need frequent editing and administration through a web interface which is just great. One of the thing that pushed me to switch from XName.org to my own DNS system was the fact that XName was pretty unreliable, even to the point where Google would drop my sites in ranking due to the fact that they were often unavailable because of DNS problems. Once I've setup my own DNS system things became pretty boring. Now I use XName as the secondary DNS.

Your thoughts

No comments

Add comment

* - required field