Web terminal lense book

Web servers

After uploading a large file to the gallery application I'd mentioned in a previous post, I discovered that there's a bug in lighttpd that eats up all the memory when shoving a large file through the proxy module.

The gallery application I'm writing is written using node and includes its own (tiny) web server. I was using lighttpd to handle the SSL part of the connection and simply proxy the requests to and from the application. That large file I'd uploaded triggered the bug when I tried to download it later. It's interesting that the upload went perfectly smoothly.

After having been unable to find any convincing fixes for the problem in lighttpd and being unwilling to try to rethink how my application works, I decided it was time to try another web server.

I toyed with the idea of - and in fact partially implemented, just for fun - a web server written with node but really, that's far more effort than I really want to go to and I suspect it wouldn't have the performance characteristics I'd want. That and I'm far too lazy to want to reinvent the wheel.

Taking my queue from work, I though I'd have a look at nginx. At Proxama, we're using nginx on our Amazon EC2 instances to proxy requests to the django application that is our application server. From my limited experience of setting it up (well, I've only needed to do it once), it seemed pretty simple to configure and yes, after half an hour or so I'd managed to set up web server with all the virtual hosts, SSL certificates, and proxy settings I had before. And with a much cleaner-looking config file ;)

For future reference, here are the tricky bits and caveats I came across:

  • Make sure you define an index somewhere as there isn't a default

    location / {
        root /srv/http/;
        index index.html;
  • The CA cert goes under the ssl_client_certificate option. This wasn't mentioned in the SSL howto page.

  • Uploads are, by default, limited to 1MB. This is controlled with client_max_body_size

  • FastCGI is a dark art and I really hope I never have to see another PHP script in my life.

    • php-fpm made it slightly easier
    • but it uses a unix socket rather than running which had me confused for a while
    • roundcube, despite being written in PHP, is still the best webmail option for me
  • Don't forget the semi-colons at the ends of lines!

So far, nginx seems to be doing the job very well, solves the issues I was having and (that I've noticed) hasn't created any new ones.

White terminal

The other day, I decided that I was bored of having white text on a black background in my xterms and resolved to spend a day working in black on white.

It didn't work; I'll stick with white on black, thanks.

Chilli lenses

No matter what method one uses (with the probable exception of using rubber gloves), however much one washes one's hands after chopping chillies, some residue remains. This became particularly manifest when taking out my contact lenses last night; yowch.

Having a liking for scotch bonnets does not help ;)


After a month's experimental non-usage, I finally deleted my Facebook account several weeks ago. I really haven't missed it. What I have noticed is that I'm quite relieved to not feel compelled to spend several minutes of every day reading through my friend feed :)

Twitter works fine for me and, because it's so full of content and I'm not personally acquainted with most of the people I follow, it doesn't compel me to catch up with every single post. The same applies to Diaspora.

I highly recommend ditching Facebook. There are an increasing number of reasons to do so which I don't think I even need go into ;)

Tags: blog