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.

my @referers; open(FH, "/etc/mail/sendmail.cw") or die "Cant open $i! : $!\n"; while(<FH>) { chomp; my $www = "www.$_"; push(@referers, $_); push(@referers, $www); } close(FH); }

humbly -c


In reply to Re: Running Perl scripts from a single CGI-BIN, on a multiple-virtual hosting server by c
in thread Running Perl scripts from a single CGI-BIN, on a multiple-virtual hosting server by ajt

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.