"Live" Apache Virtual Hosts

Associate
Joined
26 Jan 2009
Posts
848
Location
Amsterdam
I'm intending to set up a soft of Software-As-A-Service system, using Apache and a load of other things. Basically, each registered customer/user gets a URL such as
http://www.example.com/<customer name>/
I'm hoping to provide a service whereby a user can register their domain name, and have their DNS records point to us, and we will redirect traffic from their domain to their URL automatically.

I'm under the impression that I'll need to use Apache's VirtualHost functionality to achieve this, but any edits to the configuration files require a restart of Apache, and I'd like to avoid this scenario.

Are there any ways around this?
 
That will work I guess, but it won't put them in the correct location automatically, will it?

I also considered doing that and using mod_rewrite for a while, but I came up with a problem... which I appear to have forgotten for now... hmm.
 
It would if you setup your software to read the HTTP_HOST header accordingly, though you say you had a problem with that - tell us if you remember. Since you're redirecting all clients to a branded URL (why not just leave theirdomain.com?), you don't really want to be adding all these vhosts that won't be used.

In terms of restarts - try graceful.
 
Graceful looks fairly cool, I didn't know about that, thanks.

As for the re-writing, I think the problem actually was that we were going to leave theirdomain.com (so that you have theirdomain.com/index.php => ourdomain.com/them/index) but some of the application code uses hard-paths (ie. links to index.php point to ourdomain.com/them/index.php and not just index.php); I guess I'll just have to fix that.

Thanks for the help. :)
 
A graceful restart on a busy box with a lot of vhosts can give 10-30 seconds downtime. :o
If I read the manual right, this seems to be contrary to the documentation which states that there will always be the correct number of threads to serve clients, or am I missing something?
 
It's just something we found on one of our systems that was extremely busy
dunno.gif
 
I suppose it depends how much traffic it's doing and the resources it has free to manage - we don't do vast amounts of traffic through any server really.

I'd do it via the wildcard suggestion rather than any form of restart :)

As his problem with that was only minor (hard coded paths) I don't see any reason to need to worry about config files, restarts etc :cool:
 
Back
Top Bottom