See
http://www.vorteon.com/download/
for my hacks. It is called virt_host_hacks v.0.3. I've only set this up on one
machine so I can't tell you if I put everything there that you need.
The hacks intercept calls to ns_db, ns_info, ns_url2file, ns_config, and
ns_schedule and act based on the Host header.
The start_primary_site.tcl create pools for each of the sites (enough sites and
Postgres may require you up some of it's setting to support that many open
connections).
I've been wanting to make it prettier and probably will when I get time but
here's my work so far