httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Madere, Colin" <colin.mad...@ieminc.com>
Subject RE: [users@httpd] variables in httpd.conf
Date Thu, 12 Dec 2002 18:35:31 GMT
Don't mean to be picky here, but whether it's a programming language or not
doesn't mean it can't have variables/macros.  If it's parsed, this can be
done.  Witness make and ant.

So there is _no way_ to put a common string you repeat a bunch of times in
the Apache configuration into a macro so that it's not hard-coded
everywhere? (aside from using a Env var. That is not acceptable.)

> -----Original Message-----
> From:	Boyle Owen [SMTP:Owen.Boyle@swx.com]
> Sent:	Thursday, December 12, 2002 2:09 AM
> To:	users@httpd.apache.org
> Subject:	RE: [users@httpd] variables in httpd.conf
> 
> >From: Madere, Colin [mailto:colin.madere@ieminc.com]
> >
> >Ok, I know this is VERY well known but dammit if I can find a 
> >spec/example.
> >I just want to set variables for some values to use throughout 
> >my httpd.conf
> >to not hardcode things such as host names and IPs.  I've seen 
> >it done before
> >but can't find the example again (even looked through Apache 
> >docs and FAQs
> >and Googled for it).
> 
> The httpd.conf file is a plain text file that is read by an interpreter
> - it is not a programming language so you can't have variables or
> control structures in it.
> 
> You might be thinking of PassEnv, SetEnv, SetEnvIf etc. which allow you
> to define and control environment variables which are then interpreted
> with respect to live requests. But you can't do things like:
> 
> 	User ${LOGNAME}
> 
> and expect it to pick up the username of the calling shell.
> 
> To generate dynamic content for httpd.conf, most people write a perl
> script which builds the required config and then starts apache.
> 
> Rgds,
> 
> Owen Boyle
> 
> ---------------------------------------------------------------------
> 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

---------------------------------------------------------------------
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


Mime
View raw message