0

I have a farm of IIS servers which provides something akin to domain parking sites, with thousands of domains assigned to the system, and content generated dynamically. I need a load balancing and cacheing solution. My intention is to use Apache 2.2 with mod_cache and mod_proxybalance to accomplish this.

My previous experience with Apache has been rather limited, and usually dealing with only a few name based virtual hosts. I've never implemented load balancing or proxying with it before.

While researching a configuration, i'm left scratching my head over some basic configuration directives that i'm not certain how to configure for this environment. In particular, the apache docs give dire warnings about not configuring ServerName directives properly. In this situation, I'm not sure how to handle this.

The site isn't serving it's own content, but rather cached and proxied content. I can't put every domain name into seperate virutalhost directives. Are directives like ServerName (or other directives that seem to require domain names) even necessary in this situation?

EDIT:

If you would like to propose other solutions, i'm open to them. So far, ngnix has been proposed, but ngnix cannot proxy name based virtual hosts due to it's proxy code only using http 1.0 to the backend servers. I'm also uncertain if it can cache name based virtual hosts.

Varnish looks like a possible cacheing solution, but i would really like something I can host on the same server so I don't need multiple servers for each function.

Erik Funkenbusch
  • 600
  • 10
  • 27

3 Answers3

1

Basically, you will need a <VirtualHost *> for each domain, each one complete with its own ServerName and ServerAlias, inside each one you will put the directives related to proxy and cache.

I suggest you to put one domain per file, inside a common dir, and include it all from a main apache file. Most linux distros do that nowadays using directories like Debian/Ubuntu's sites-available and sites-enabled - all the domains are files inside the available dir and simply linked inside the enabled dir to be activated.

And I know that it's not what you asked, but since it's just domain parking have you considered using nginx? It's designed to things like this (front end to receive big hits and serve static/cached/proxied content).

coredump
  • 12,713
  • 2
  • 36
  • 56
  • That's highly impractical. It's not actually domain parking, it's just more similar to it than not. It's actually a portal system with over 50,000 domain names. I can't even imagine 50,000 vhost entries. The maintenance alone would require.. way too much. Thanks for the tip on nginx. – Erik Funkenbusch Sep 22 '10 at 03:14
  • In checking out the documentation for nginx, it doesn't look like it can handle my specific need. In particular, the proxy function speaks http 1.1 to the client and http 1.0 to the internal servers, which my understanding means you can't forward host headers and thus can't proxy name based virtual hosts – Erik Funkenbusch Sep 22 '10 at 03:35
1

If you intend to replace the backend, mod_vhost_alias

Otherwise, if you are just putting caching in front of your existing solution, Varnish or Squid would be better suited. Varnish has built-in support for backend load balancing, health checks, etc. You could also run a pair of ipvs servers in front to load balance and provide 100% uptime to a pair (or more) Varnish servers.

karmawhore
  • 3,865
  • 18
  • 9
  • No, I won't be replacing the backend. I just need a caching solution and load balancing solution. I've looked a bit at Varnish, but it's pretty sparse in terms of information on it. – Erik Funkenbusch Sep 22 '10 at 14:27
  • Varnish is looking pretty good... got it up and going with minimal configuration and I like the built-in load balancing features. – Erik Funkenbusch Sep 22 '10 at 22:06
0

You might want to take a look at http://httpd.apache.org/docs/2.0/vhosts/mass.html and especially the last paragraph. I've successfully run mass vhosting with mod_rewrite.

Wouter de Bie
  • 719
  • 5
  • 7