On Sep 14, 2006, at 4:58 PM, Geronimo wrote:
PROBLEM:
I need to pass an argument to startup.pl, in order to associate
Apache2 with a specific version of an app. The app version has a
simple identifier, say 'dv1'.
What I'm trying to do is emulate passing an argument on the command
line, which will show up in @ARGV, like;
$ /devel/startup.pl dv1
use $ENV
either set it on the command line, do some fancy stuff with
apachectl's -D , or include multiple apachectl files
or 2/3 all at once! ( just to show how )
apachectl -D dv1 start
httpd.conf
<ifDefine dv1>
include startup_dv1.pl
</ifDefine>
include startup.pl
startup_dv1.pl
do some specific dv1 stuff here
$ENV{'myAppServer'}= 'dv1
startup.pl
if ( $ENV{'myAppServer'} eq 'dv1 ) {
etc
}
I personally
make heavy use of -D to handle server versions ( so the same
startup.pl and httpd.conf work on OSX , ubuntu and FreeBSD )
include a per-server version of startup.pl, before including
startup.pl , so i have the right things for the right os
set $env within perl for server specific code