Record of some of the computer tech I deal with so that it's documented at least somewhere.

Monday, 20 August 2007

Installing lighttpd 1.4.13

I've found out that lighttpd (I can't bare to call it lighty) doesn't do conditional re-writes, it's all or nothing.

I found a modified mod_rewrite.c that will only re-write if the file is not found
http://lmmrtech.com/lighttpd_mod_rewrite_with_file_exists_check

Having noticed Linux' mount --rbind stuff I keep thinking it is anything like as useful as plan9's bind.

mount --rbind /home/maht/mod_rewrite.c mod_rewrite.c
make

but then I remembered the shocking truth, 1) you have to be root 2) it hangs around until reboot or umount. I've decided it's even less useful than a symlink, at least they show up in an ls. Linux' rbind gives the whole concept a bad name "It's a bit like Linux' rbind" is not going to persuade anyone of the usefulness of plan9's bind and private namespaces.

on with the pony

mv src/mod_rewrite.c src/mod_rewrite.c.old && cp /home/maht/mod_rewrite.c src/

apt-get install libpcre3-dev

./configure --with-pcre --with-openssl --prefix=/usr --with-bzip2

--with-fam didn't work even though I apt-get installed gamin & pkg-config - I'll come back to this, FAM looks interesting - also found pbzip2 that could be useful.

and hey whaddya know, it works just fine

url.rewrite-final-NF = (".*" => "/index.php")

and any files requested from public_html were left right alone

now to see if ixp works


later ....
it has a bug see the // *sigh* I had a quick look but I can't see where it is
2007-08-20 19:15:38: (mod_rewrite.c.407) my-path : /var/www/tham/public_html//imgs/lfg_dbg_curve.gif exists

BUFFER_APPEND_SLASH(path);
the slash after public_html is added by the system as my lighttpd.conf doesn't have trailing slashes so I'm guessing that's safe to remove, and the chatty logging while I'm at it.

No comments: