httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <>
Subject RE: [users@httpd] defining variables for httpd.conf
Date Wed, 23 Apr 2003 07:42:30 GMT
>-----Original Message-----
>From: Jozef Nowak []
>I would like to ask your advice about defining variables (or 
>constants) in the httpd.conf file. 

The config file is a plain text file which apache reads and parses at
runtime. It doesn't support any variable substitution or control
structures. The only way I know to do this type of thing is to write a
script which does something like this:

- read in template httpd.conf
- grab environment variables or command line arguments into local
- substitute local variables into httpd.conf
- write out edited httpd.conf
- start apache

You can do this with a shell script or with perl fairly easily...

Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

>I have the following in my httpd.conf file:
>    ProxyPass /dir1/	http://server1/srv1/dir1
>    ProxyPass /dir2/	http://server1/srv1/dir2
>    ProxyPass /dir3/ 	http://server1/srv1/dir3
>The "server1" is different if this httpd.conf is used on 
>different machines. Currently if I want to use the httpd.conf 
>on another machine, I have to search and replace every server1 
>with appropriate hostname.
>I would like to have a generic httpd.conf where I could define 
>a "myserver" variable once and then use it like this:
>set myserver=server1
>    ProxyPass /dir1/	http://%{myserver}/srv1/dir1
>    ProxyPass /dir2/	http://%{myserver}/srv1/dir2
>    ProxyPass /dir3/ 	http://%{myserver}/srv1/dir3
>Is it possible?
>Sign-up for your own FREE Personalized E-mail at
>The official User-To-User support forum of the Apache HTTP 
>Server Project.
>See <URL:> for more info.
>To unsubscribe, e-mail:
>   "   from the digest:
>For additional commands, e-mail:

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company. 

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message