httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] defining variables for httpd.conf
Date Wed, 23 Apr 2003 07:42:30 GMT
>-----Original Message-----
>From: Jozef Nowak [mailto:jnowak@email.com]
>
>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
variables
- 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...

Rgds,
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?
>
>Thanks,
>
>Jozef
>-- 
>_______________________________________________
>Sign-up for your own FREE Personalized E-mail at Mail.com
>http://www.mail.com/?sr=signup
>
>
>---------------------------------------------------------------------
>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
>
>

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