Think about Loose Coupling | |
PerlMonks |
Re: Running Perl scripts from a single CGI-BIN, on a multiple-virtual hosting serverby c (Hermit) |
on Oct 02, 2001 at 19:41 UTC ( [id://116154]=note: print w/replies, xml ) | Need Help?? |
I've found myself in a very similar situation to your own, and headed down the same path. In the end, I decided that coming up with a global configuration file that each globally accessible script could pull from was just not the solution I was looking for. After all, some scripts just needed a small bit of tweaking to make them usable by all virtual hosts on my machine. Instead, I took the approach of tweaking each script such that it would be globally usable without further editing by end users, and hopefully in a manner that would allow the script to avoid further editing as new domains were placed on the machine. My small case in point is something that I think you referred to in your post, a formmail script. The script relies on checks against the $ENV{'HTTP_REFERER'} variable and provides an array that can hold the various domains on your machine. To make the script globally accessible without having to update it per domain, I rewrote the array to pull all local domains from already existing file like /etc/mail/sendmail.cw or perhaps your zone files from dns. Regardless of how you do it, chances are that each script just needs a small rewrite to bring it up to speed as globally accessible. I am far from being a monk with major perl-fu power, but it certainly fit my needs and took very little time to do.
humbly -c
In Section
Seekers of Perl Wisdom
|
|