Desilets, Alain wrote:
Nevermind, I found the answer on this page: www.issociate.de/board/goto/1147159/Using_environment_variable_in_httpd.conf.html Although it's an undocumented features, you can acess the OS env variables with a syntax like: ${WEBITEXT_HOME}. I tried it and it works. The funny thing is that I am sure I tried this 3 weeks ago and it hadn't worked. Oh well. Alain
I use this syntax too, but I think it works for me only because of my loading of a NON-STANDARD module, mod_define. http://people.apache.org/~rjung/mod_define/mod_define.html
-----Original Message-----From: Desilets, Alain [mailto:Alain.Desilets@xxxxxxxxxxxxxx] Sent: Wednesday, January 25, 2012 6:51 AMTo: users@xxxxxxxxxxxxxxxx Subject: Can you use variables inside a conf file? Hi, this is my first posting here. I have a mod_perl application called WeBiText, which needs to push a number of directories on the Perl include path. At the moment, I do this by including the following in my httpd.conf file: PerlSwitches -IC:/Users/Desiletsa/Documents/eclipse_workspace/WeBiText PerlSwitches -IC:/Users/Desiletsa/Documents/eclipse_workspace/WeBiText/GUI PerlSwitches -IC:/Users/Desiletsa/Documents/eclipse_workspace/WeBiText/bin PerlSwitches -IC:/Users/Desiletsa/Documents/eclipse_workspace/IIPerlUtils/TestingAndDebugging PerlSwitches -IC:/Users/Desiletsa/Documents/eclipse_workspace/IIPerlUtils PerlSwitches -IC:/Users/Desiletsa/Documents/eclipse_workspace/PerlCorpusMiner This is not great, because it hardcodes the pathes into the httpd.conf, which means that they possibly have to be changed everytime I install the app on a different machine. I would much prefer to write something like this: PerlSwitches -I$ENV{WEBITEXT_HOME}/WeBiText PerlSwitches -I$ENV{WEBITEXT_HOME}/WeBiText/GUI PerlSwitches -I$ENV{WEBITEXT_HOME}/WeBiText/bin PerlSwitches -I$ENV{WEBITEXT_HOME}/IIPerlUtils/TestingAndDebugging PerlSwitches -I$ENV{WEBITEXT_HOME}/IIPerlUtils PerlSwitches -I$ENV{WEBITEXT_HOME}/PerlCorpusMiner where WEBITEXT_HOME is an OS environment variable which already needs to be set for other reasons. Alternatively, I would be OK with using $WEBITEXT_HOME instead of $ENV{WEBITEXT_HOME}, where $WEBITEXT_HOME would be a variable whose value is passed to httpd using a command line option. Is this possible? I looked around on the web and it seems that OS environment variables can only be accessed inside <Perl> sections. And unfortunately, I can't use <Perl> sections for that specific purpose, because those sections can only appear after you have loaded mod_perl, and by then it's already too late to modify the Perl include path. Any help would be appreciated. Thx. Alain --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
-- J.Lance Wilkinson ("Lance") InterNet: Lance.Wilkinson@xxxxxxx Systems Design Specialist - Lead Phone: (814) 865-4870 Digital Library Technologies FAX: (814) 863-3560 E3 Paterno Library Penn State University University Park, PA 16802 --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx