New software always causes surprises

Monday, 21 March 2011

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 \
             libapr1

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

| 4 comments.

 

Comments On This Entry

[gravitar] Simon Proctor

Submitted at 16:43:39 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 :)

[author] Steve Kemp

Submitted at 16:54:45 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 127.0.0.1.

[gravitar] Kai

Submitted at 12:39:14 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.

[author] Steve Kemp

Submitted at 14:17:31 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.

 

Comments are closed on posts which are more than ten days old.

Recent Posts

Recent Tags