aw at ice-sa
Jan 17, 2012, 1:31 AM
Post #1 of 6
serve items in "lib" or "PATH" fashion
I run a series of mostly-identical websites under Apache2/mod_perl2 (and Template::Toolkit).
common /cgi-bin/*.pl directory and so on. This is done via Alias'es in each website's
<VirtualHost> configuration file, pointing to a common location.
However, once in a while - tending over time to become "quite often" - one of these
cgi-bin scripts. At the moment, I solve that by giving this website, then, its own
/cgi-bin/ directory, copying *all* the standard cgi-bin scripts there, changing the
/cgi-bin/ Alias to point to this own cgi-bin directory, and then modifying the one cgi-bin
script that is special for that website.
But of course then I am stuck forever now with this separate cgi-bin directory to
maintain, containing not only the one script which is different, but all the others too.
I would much prefer if I could give each of these <VirtualHost> sections a list of
directories in which to look for a target document or script, much like the way in which
the PATH or PERL5LIB variables are used.
E.g. I would be happy if I could write this in the Apache configuration :
ScriptAlias /cgi-bin/ /var/www/site1/cgi-bin/;/var/www/global/cgi-bin/
and have Apache look first in the local one, then in the global one each time it is
Now my question is : does anyone know of an Apache add-on module doing something similar ?
; does anyone know of an add-on mod_perl module which would do something of the kind ?
I have already searched, but as I do not know exactly which terms to use for such a
search, I have not found anything yet.
I'll write my own PerlFixupHandler or so to do this if I have to, but if it already
exists, I would not bother.