I thought I'd weigh in on two items of note....
On Oct 13, 2009, at 12:17 PM, Scott Gifford wrote:
When I have done this in the past, I have done it with generating
configuration files, so of course one misplaced newline or
angle-bracket will kill the server. Maybe generating the
configuration directly from a <Perl> section is more robust? Maybe
there are ways to catch configuration errors in that layer and handle
them cleanly without preventing Apache from starting? Any suggestions
in this area would be appreciated.
It seems to me that you are assuming that your script must apply the
new configuration to the live apache server.
Why not have your script simply apply a potential new configuration to
a "test" apache installation (separate from all others), have it
restart apache there, hit a few critical URLs to test functionality
and then report to you if there's an error. If it's successful, it can
then apply that config to the live cluster, keeping fingers crossed,
of course. (and making sure your monitoring software is going to pull
the fire alarm if the cluster goes down.)
If there's an error, you have some time to gracefully solve it and
your system continues to run in the meantime. Of course, this means
that the new configuration wasn't applied, but in the grand scheme of
things, a missing update to a config is far, far better than taking
down an entire cluster because your automatic configurator has a screw
loose.
On another note, regarding mod_vhost_alias and a database lookup to
dynamically do something...
"Ryan Yagatich" <ryagat...@gmail.com> writes:
What about mod_vhost_alias? (
http://httpd.apache.org/docs/2.0/mod/mod_vhost_alias.html )
<quote>
Summary
This module creates dynamically configured virtual hosts, by
allowing the IP
address and/or the Host: header of the HTTP request to be used as
part of
the pathname to determine what files to serve. This allows for easy
use of a
huge number of virtual hosts with similar configurations.
</quote>
Thanks! That looks very close to what I want. I wonder if there is a
way to do a database lookup and substitute that?...
In my experience, you really want to minimize the hits on your
database and placing a lookup of any kind for -every- connection to
apache would be murderous regardless of which database you're using.
--Joel