[Pdx-pm] Sourcing profile from within cgi script

Eric Wilhelm enobacon at gmail.com
Fri Apr 16 10:28:41 PDT 2010

# from Daniel Herrington
# on Friday 16 April 2010 09:51:

>The issue that sparked this is we're attempting to avoid setting the
>variables statically anywhere in perl or apache. Since the profile
>changes each time an upgrade occurs, we're looking to avoid
>redevelopment efforts in the future.

If the environment is in some easily-parseable file, then you can just 
parse it as data.

But, if it has some interpolations or shell operators, then you probably 
want the shell to interpret all of that.  If you can't squeeze it into 
the mash of shell scripts from the init.d/apache startup process 
(/etc/default/apache2?), it might be easiest to read the output of 
`env` from a short shell script which sources the file.  This would add 
a few subprocesses to the script, so you'll want to do that at server 
start instead of on each hit.

"Insert random misquote here"

More information about the Pdx-pm-list mailing list