Re: Load balancing multiple virtual hosts on 1 IP



On Sat, Jan 31, 2009 at 09:23:36AM -0400, Marc G. Fournier wrote:

Simple: is it possible?

I have two VMs that contain the same content, on two different IPs .. I
want to setup a third VM with something like haproxy on it that will take
the URL (http://domain1) and pull the content from one or the other ...

So far, all works well if I only have one virtual host, but as soon as I
add a second one (http://domain2), when I try to go to http://domain2, it
pulls up the content for domain1 also, as if I was going to http://IP
instead.

Is there a way to set this up (with haproxy, or some other software), that
it will actually pass the URL through to the backend apache server and
load up the right content? Or is this a limitation in the protocol
itself?/

Sounds like your front end is messing up the request. If the back end
servers get the correct domain in the host header, they should do the right
thing and return the data from that domain.

As for alterntatives...

I have used "pen" for simple load balancing of web servers, and it does
what you need. Very minimal and simple.

Apparently, Slashdot uses "pound" for their load balancing, so it should do
the trick, too.

On the slightly more complex side, I've recently starting using "varnish"
to split work between Apache and nginx (all three running in the same jail,
thus all bound to the same IP address). It is capable of doing what you
need, but it's main purpose is a reverse caching proxy, so a bit more care
would be needed if you don't actually want stuff cached.

All three (pen, pound, and varnish) are in ports.

-- Geoff
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Need Advise - Upgrading Windows 2000 Server to 2003.
    ... To upgrade/migrate IIS with load balancing better choose IIS newsgroup: ... I would try an inplace upgrade in a test lab first. ... mixture of Web Servers and 3rd party application servers. ... migrating the settings over. ...
    (microsoft.public.windows.server.setup)
  • Re: TS Session Directory and Load Balancing
    ... I've never used MSFT's Load Balancing for TS. ... >>> We are in the process of deploying Terminal Services Session Directory ... >>> servers in the farm that will participate in the Session Directory are ... We will configure these WTS client servers to point ...
    (microsoft.public.windows.terminal_services)
  • Re: Can extra processing threads help in this case?
    ... have multiple requests and on multi-core machines multiple servers. ... you will need to consider a store and forward concept for your request and delayed responses. ... In practice the "FIFO" would be at the socket level or listening level with concepts dealing with load balancing by restricting and balancing your connection with worker pools or simply letting it to wait knowing that processing won't be too long. ... Some servers have guidelines for waiting limits. ...
    (microsoft.public.vc.mfc)
  • RE: load balancing as a webserver backup
    ... One way to do this is to use Network Load Balancing. ... It requires Windows ... >if costing money) way to run two Windows 2000 servers ...
    (microsoft.public.win2000.networking)
  • Re: NFS load balancing advice needed
    ... > sharing most of a terabyte worth of very small files. ... > There are about 100 Linux clients using the data, ... > I'm investigating solutions for implementing some load balancing and ... > the fact that different servers will have different filehandles for the same ...
    (comp.unix.solaris)