You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "James Robertson, Learning Media" <ja...@learningmedia.co.nz> on 2004/01/12 21:01:33 UTC

[users@httpd] Setting/echoing a variable within a VirtualHost directive?

Hello

Within an Apache (1.3) config file, is there any way to set and echo a
variable within a VirtualHost directive?

Eg. [The following doesn't work but hopefully shows what I am trying to
achieve with SITE_PATH.]

<VirtualHost *>
    SetEnv SITE_PATH /Library/WebServer/test_site
    ServerName test_site.my_server
    DocumentRoot %{ENV:SITE_PATH}/www
    php_value auto_prepend_file %{ENV:SITE_PATH}/php/site.php
</VirtualHost>

Cheers
James



---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Setting/echoing a variable within a VirtualHost directive?

Posted by Joshua Slive <jo...@slive.ca>.
On Tue, 13 Jan 2004, James Robertson, Learning Media wrote:

> Hello
>
> Within an Apache (1.3) config file, is there any way to set and echo a
> variable within a VirtualHost directive?
>
> Eg. [The following doesn't work but hopefully shows what I am trying to
> achieve with SITE_PATH.]
>
> <VirtualHost *>
>     SetEnv SITE_PATH /Library/WebServer/test_site
>     ServerName test_site.my_server
>     DocumentRoot %{ENV:SITE_PATH}/www
>     php_value auto_prepend_file %{ENV:SITE_PATH}/php/site.php
> </VirtualHost>

No.  httpd.conf is a config file, not a programming language.  There are
plenty of programming languages designed for exactly this task; I suggest
you use one of them to preprocess the config file.  (Examples: m4, cpp,
etc).

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: Setting/echoing a variable within a VirtualHost directive?

Posted by "Webmaster, Learning Media" <we...@learningmedia.co.nz>.
Thank you very much Joshua. Both these modules look like just what I want.

I couldn't trouble you to tell me the home-page for mod_define could I? [I
have had a good look on Google and at modules.apache.org and can't find the
definitive source.]

James

On 1/20/04 10:04, in article
Pine.WNT.4.58.0401191603560.1560@Poste3947.hec.ca, "Joshua Slive"
<jo...@slive.ca> wrote:

... 
> (One other note...)
> 
> There are, however, third-party modules like mod_define and mod_macro
> that will do this sort of thing internal to apache.
> 
> Joshua.
... 




---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Setting/echoing a variable within a VirtualHost directive?

Posted by Joshua Slive <jo...@slive.ca>.
On Tue, 13 Jan 2004, James Robertson, Learning Media wrote:
> Within an Apache (1.3) config file, is there any way to set and echo a
> variable within a VirtualHost directive?

(One other note...)

There are, however, third-party modules like mod_define and mod_macro
that will do this sort of thing internal to apache.

Joshua.

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org