Why are you not using config files and only set the path to this file like this.

<VirtualHost *:80>
PerlSetVar my_cnf /etc/vhostconfs/80.cnf
<VirtualHost>

<VirtualHost *:81>
PerlSetVar my_cnf /etc/vhostconfs/81.cnf
<VirtualHost>

80.cnf
---------8<---------
HTML_TEMPLATE_ROOT = "/websites/80/templates"
--------->8---------

You could read the config-file when your application starts-up and then retrieve the values very easily using something like e.g.
http://search.cpan.org/~wadg/Config-IniFiles-2.38/


Tom

Chris Faust wrote:
Hello,
I'm having a hard time figuring out a approach to what I thought would be a simple thing, but after reading a bit through the docs I'm more confused now and was hoping to get some advise.
What I want to do is have a single mp2 script service multiple virtual hosts, in order to do this I'd need to set some specific settings related to that virtual host which I can then retrieve from the mp2 script - being able to set something like a hash in the conf for each virtualhost and then have access to all those keys and values would be perfect.
For a example, I use HTML template, in my script I define the location of all my templates:
$ENV{'HTML_TEMPLATE_ROOT'} = "/websites/domain1/templates";
I want that to become something like
$ENV{'HTML_TEMPLATE_ROOT'} = $settings{'this_path_was_defined_in_the_conf_for_this_vh'};
So now that line is good for all the virtualhosts.
Thanks
-Chris


--
b e s t s o l u t i o n . a t                        EDV Systemhaus GmbH
------------------------------------------------------------------------
tom schindl        leiter softwareentwicklung   mobile  ++43 664 3145958
------------------------------------------------------------------------
eduard-bodem-gasse 8/3    A-6020 innsbruck      fax      ++43 512 935833
http://www.bestsolution.at                      phone    ++43 512 935834

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to