About Archive Tags RSS Feed


New software always causes surprises

21 March 2011 21:50

I recently deployed my node.js proxy server, removing all traces of Apache2 from my main server. During the course of this transition I discovered:

Bugs in my code

Not unexpected, in all honesty.

There were two main issues; the first was relating to how I handled the 304 response, the second was relating to how I performed rewrites for my mercurial repository vhost.

Bugs in node.js

Given how new node.js is there wasn't a huge surprise here either, although I thought I'd been good testing against 0.2.x. As it turned out I needed to run the more recent 0.4.x to avoid a couple of issues:

In short I have a backported node.js package for Squeeze which is almost worthless. I'll update it in the near future. For the moment:

cd node-v0.4.3/
./configure --without-ssl --prefix=/opt/node-0.4.3 && make && make install
ln -fs /opt/node-0.4.3  /opt/node
Oddities in thttpd
thttpd is what actually runs my websites and I discovered during some extended debugging sessions that it just does not like HTTP requests starting with a doubled "/" character.

For example this works fine:

wget http://www.acme.com/software/thttpd/

But this fails:

wget http://www.acme.com//software/thttpd/

Previously it seems that Apache was (silently) fixing this up before it proxied requests. Now I have to do it myself, no big thing, but still a surprise.

All in all it was worth it to be able to run:

dpkg --purge libapache2-mod-rpaf \
             apache2.2-common \
             apache2.2-bin \
             apache2-utils \
             apache2-mpm-prefork \
             apache2 \
             libaprutil1-dbd-sqlite3 \
             libaprutil1-ldap \
             libaprutil1 \

ObQuote: "Bad news. The fog's getting thicker." - Airplane!



Comments on this entry

icon Simon Proctor at 16:43 on 21 March 2011

Shiny. I've been pootling about with node myself the last few weeks and as usual you have put me to shame. And I may nick chunks of this for my site too :)

icon Steve Kemp at 16:54 on 21 March 2011

"Steal" away - and if you spot any oddness or issues shout.

It seems, based on other recent comments, that there are other similar things out there. But this certainly suits my needs which is to listen on *:80 and pass each incoming request to a particular thttpd instance listening on

icon Kai at 12:39 on 22 March 2011

Uh. Kind of "famous last words"?

dpkg --purge libapache2-mod-rpaf \
apache2.2-common \

... *.repository.steve.org.uk seems to be down.

icon Steve Kemp at 14:17 on 22 March 2011

Ha! I was just in the middle of fixing that - I forgot a "req.end();" in my custom handler - sorted now.