30th ... err ... 24th of may
June 2nd, 2007 — Posted by benedikt — Filed in Linux
It was planned to be the 30th, but in the end everything was a week earlier. The great rush of many fans to nightwish.com in order to see the band’s new voice. It all started on 23th with the leaking of Nightwish’s new single “Eva” on some online music stores. The desicion to release all information the next day was made only a few hours later. There was only one problem: the server wasn’t already prepared for this. Thanks to the fast responses of Nebula and Hetzner we could set up three more servers and mirror the page on them. I was using pound to load balance the three servers at Hetzner. Nebula’s server was added via Round Robin DNS. Everything worked fine until we released the news … pound simply crashed and blocked port 80 completly. It might have been my own fault but well … it was impossible to use it. After one hour of investigations it simply shut pound down. And simply started lighttpd … surprisingly (or maybe, not really?) it handled all the requests without any problem! We had up to 600 requests per second. On Nebula’s we even had up to 2400 rq/s during my investigations on the load balancer. After this one I’m officially a fan of lighttpd! :-)
HowTo: Setting up Lighttpd + fastcgi
May 22nd, 2007 — Posted by benedikt — Filed in Articles, Linux
This short tutorial is going to show how to set up Lighttpd with fastcgi on Debian 4.0 (Etch). Actually it’s nothing special but I hope it demonstrates how easy it is. ;-)
What is Lighttpd?
Lighttpd is a light (I bet you already guessed that … ;)), fast and secure high performance web server. It perfectly fits the needs for high load websites but it’s not the best choice for servers hosting multiple independant websites. There are some popular sites running on lighttpd (eg. Youtube).
Installation
If you’ve been running apache, the first step is to stop it: 1 apache2ctl stop
Afterwards you can savely install the lighttpd package:
1 aptitude install lighttpd
It should install smoothly and start itself when finished.
Basic Configuration
Lighttpds default configuration on Debian file is /etc/lighttpd/lighttpd.conf. The default settings might be just fine for your needs, but it’s a bit messy for my taste. So let’s simply write our own. Open the configuration with your favorite editor.
1 # Modules 2 server.modules = ( 3 "mod_access", 4 "mod_alias", 5 "mod_accesslog", 6 "mod_rewrite", 7 "mod_compress", 8 "mod_evhost" 9 )Of course there are a lot more modules. Just take a look at the list provided in the Lighttpd documentation wiki. We’ll use
mod_evhost to simulate multiple virtual hosts. More on this later.
Next we’ve to set some required values in order to get the server working. This should be self explaining:
1 # Server settings 2 server.port = 80 3 server.pid-file = "/var/run/lighttpd.pid" 4 5 server.username = "www-data" 6 server.groupname = "www-data" 7 8 # Document root 9 server.document-root = "/var/www/default"In order to use logging we also need to set the following two paths:
1 # Logs 2 server.errorlog = "/var/log/lighttpd/error.log" 3 accesslog.filename = "/var/log/lighttpd/access.log"You also might want to set index file names and enable directory listing. Do this by adding this to your configuration file:
1 # Index files 2 index-file.names = ( 3 "index.php", 4 "index.html", 5 "index.htm" 6 ) 7 8 # Directory listing 9 server.dir-listing = "enable"To finish the basic configuration we’ve to add two more lines. They’re used to load more configuration files located in
/etc/lighttpd/conf-enabled/ and to load the mime-types:
1 # External configuration files 2 include_shell "/usr/share/lighttpd/create-mime.assign.pl" 3 include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
Don’t forget to save! ;-)
Enabling fastcgi support
In order to use ruby or php on our server we need to activate lighty’s fastcgi module. This can be done by running: true You’ll see a list of available modules and asked to enter the module in question (fastcgi). Afterwards open up /etc/lighttpd/conf-enabled/10-fastcgi.conf to see the fastcgi configuration. By default php4 support is enabled. In order to use it you need to install php4-cgi:
true
In order to use the newly created configuration file we need to restart lighttpd:
true
That’s it! Now go and place a file like this called info.php in /var/www/default:
1 <?php phpinfo(); ?>View it’s output by visiting http://www.your-domain.com/info.php. If everything worked you should now see php’s details.
Nightwish nightmares ...
May 15th, 2007 — Posted by benedikt — Filed in Linux

Somehow a funny story … but actually: not at all. I was sitting in car and traveling to the train station when I received the first SMS. The Nightwish.com server is getting slow. As we posted the studio dairy of Nightwish’s new vocalist on Sunday, I wasn’t much surprised and not worried. We had some minor problems on sunday evening, directly after posting the diary, but were able to resolve them quickly. About an hour after the first SMS, while sitting in train, I got a second: The server isn’t responding anymore at all. Funny thing to know everything is going as wrong as it can and only being able to write this text about it (offline of course). I decided to move from Apache and mod_php to Lighttpd.and fastcgi, as fast as possible. The server being down today is clearly a big fat warning sign flashing over our heads. I doubt the box will survive the 30th …
I managed to switch to lighttpd after arriving back home in Fulda. Had to change the CMS a bit, but nothing special. The cause of all the problems was apache using about 150MB RAM for each of it’s processes (up to 150) on the 2GB RAM box. Everything is running better and faster now …
I’ll keep you up to date … ;-)
Upgraded nightwish.com to Debian Etch
May 4th, 2007 — Posted by benedikt — Filed in Linux

I just finished upgrading nightwish.com to Debian 4.0 Etch. Took me some time, but worked without any notable problems. (Thanks to the excellent documentation)
This was just another step in embattling the server for the 30th of this month. We’re expecting a lot of fans overrunning the website, as the identity of the new vocalist is going to be announced this day.
