[NBLUG/talk] apache virtual hosts - mod_proxy

Eric Eisenhart eric at nblug.org
Fri Apr 25 16:28:37 PDT 2008


On Fri, Apr 25, 2008 at 03:40:04PM -0700, mark at oswizards.com wrote:
> I have a question about apache virtual hosts and mod_proxy.  I am trying
> to setup a website that queries multiple internal/private hosts, like
> aa.bb.org, ab.bb.org, ac.bb.org, etc.
> 
> Does anyone know of any good resources for setting up apache virtual hosts
> that are setup to query internal hosts using mod_proxy.

I'm a little unclear what you mean...

Do you mean that you'd like to do load-balancing, where an incoming request
is randomly assigned to one of aa, ab or ac?  (via proxy so it's hidden from
the user)  Or maybe assigned more intelligently than purely randomly? 
That's http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html

Do you want requests to map in some calculable way to the backend servers? 
ie, www/q/* always goes to aa/z and www/drupal always goes to
ac/monkeys/drupal?  This could be done pure mod_rewrite and mod_proxy,
basically...  A RewriteMap and a .txt file or local DB file, maybe...  
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritemap

Do you want requests to map to backend servers via data fetched from a
backend server?  This probably requires using a RewriteMap with a program
instead of a static file.

Do you want to have an incoming request generate a try for something on aa,
then if that doesn't exist try for something on ab, then finally try for
something on ac?  Looking for content wherever it might be hidden?  It's a
little tricky, but I think you can do that with weird tricks on
error-handling in the rewrite rules...
-- 
Eric Eisenhart
NBLUG Co-Founder
The North Bay Linux Users Group -- http://nblug.org/
eric at nblug.org, IRC: Freiheit at fn AIM: falschfreiheit
Jabber/XMPP/GTalk: freiheit at gmail.com



More information about the talk mailing list