On Wed, Jan 6, 2010 at 10:59 PM, Stuart Henderson <[email protected]> wrote: > On 2010-01-05, Robert <[email protected]> wrote: >> On Mon, 04 Jan 2010 16:11:20 -0800 >> [email protected] wrote: >> >>> I'm looking for some advice on how to best address a small problem. I >>> have a network behind pf/NAT on a Soekris net5501. The network >>> includes a publicly accessible website. Let's call it ww1.domain.com. >>> Now I need to create another website, ww2.domain.com, hosted on a >>> different physical server. How can I direct incoming connections on >>> TCP port 80 (or 443) to the correct internal IP address based on the >>> URL? >>> >>> I would prefer to do this on the Soekris, rather than redirecting >>> requests from one web server to the other. I'm guessing that a proxy >>> like squid might be appropriate, but I don't have any personal >>> experience with it, and it probably does much more than I need. Would >>> this be a good way to go, or can someone suggest a simpler, more >>> lightwieght solution? >>> >>> Thanks in advance for any advice. >> >> man relayd > > relayd can't do this based on Host headers (i.e. hostname from the > URL). Squid is a bit heavy for this sort of thing, look at pound > (or maybe perlbal or varnish). > >
While I was looking for ways to parse Apache logs, I stumbled upon a web page that dealt with "Cool tricks" with Perl and Apache [1] (12 years old now, but a few decent ideas) which has some perl script for a very basic "load balancer" which would dynamically redirect requests to random web servers in your server farm (which you would have to define). With a little work, you could base this on traffic from the last 5 minutes. You could make it output a pseudo-image which could be included in each page of your site, providing reasonably accurate usage stats to base load on. What's more, it'd be small enough in footprint to run on your Soekris box. HTH [1] http://stein.cshl.org/WWW/docs/handout.html -- Aaron Mason - Programmer, open source addict I've taken my software vows - for beta or for worse

