According to John Darrow:
> I need to be able to run the same sets of pages in several different
> environments (basically just different environment variables). The problem
> is that once a process is initiated in a certain environment it can't be
> changed for the life of the process. The first stroke to solve this would
> say that I need to run several Apache servers each with a slightly different
> config file. Then each environment would run on its own port.
What determines the correct values per hit? You can use SetEnv in
virtualhost context, SetEnvIf on the fly based on several
considerations, or do some real black magic with the E= flag
in a RewriteRule.
> The problem with that solution is that maintaining the servers becomes a
> headache. You have to bounce many different Apache servers everytime
> something changes.
This turns out to be a mixed blessing when you really only want
to change one of the environments but it is probably too much
trouble except for drastically different servers like with/without
mod_perl or a secure proxy.
> With java servlets there is a feature that allows you to specify different
> zones within a single Apache server. Each zone has a unique config file and
> so it can deal with the environments that way. I'm wondering if there's
> anything similar for mod_perl?
The above, plus the ability of mod_rewrite or ProxyPass on a front
end server to proxy different requests to different backends.
> The only other thing I can think of is to just have several copies of the
> same scripts, and then depending on the URI they will be smart enough to
> know to set their own environment variables upon initialization. Apache
> would then keep processes separate depending on where the scripts are using
> the URI. But that's sort'f ugly.
It is a good idea to make sure the reason for the different
behaviour based on these values is clear within the script,
especially if there is any chance that different people
will make changes separately to the apache config and the
scripts. If letting the script parse the URI itself makes
it more obvious then it isn't as ugly as the magic to hide
it.
Les Mikesell
[EMAIL PROTECTED]