You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Bgs <bg...@bgs.hu> on 2006/04/03 16:42:59 UTC

Re: [users@httpd] Dynamic config parameters

  Hm.... no reaction :/

  Does this mean that it's so trivial or that it's not possible? :)

Bgs wrote:
> 
>  Hi all,
> 
> 
> I couldn't find info on this subject...
> 
> I have multiple webservers wich are loadbalanced. They only differ in 
> their IP and a unique virtualhost used for testing. 
> (site.com/www.site.com is common, web01.site.com is unique).
> 
> Is there a way to create az includable config in which these numbers are 
> dynamic parameters?
> 
> Like: <VirtualHost %I>
> Where %I is the IP number (take from where?). Or is it possible to use 
> some environment variable?
> 
> 
> Thanks
> Bgs
> 
> 
> 
> ---------------------------------------------------------------------
> 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


Re: [users@httpd] Dynamic config parameters

Posted by Bgs <bg...@bgs.hu>.
A 'bit' late reply:

By preprocessor I was talking about a script generating the include 
files. Practically the same as you do. I have config files for the 
script and a main template I edit when something changes. Then run the 
script and restart apache. :)

Antoine Prevosto wrote:
> May be you could also share common configuration files between your 
> load-balanced servers, and "Include" configuration files whit directives 
> specific to each one.
> 
> That is the way I work with my servers, so maintenance is kept easy (no 
> preprocessor, no envvar).
> 
> Brgds
> Antoine.
> 
> 2006/4/6, Bgs <bgs@bgs.hu <ma...@bgs.hu>>:
> 
> 
>     Just for the records: I had to choose the preprocessor version.
> 
>     Bgs wrote:
>      >>> <VirtualHost %IP>
>      >>>  ServerName domain.com <http://domain.com>
>      >>>  ServerAlias www.domain.com <http://www.domain.com>
>     web%NUM.domain.com
>      >>> ...
>      >>> </VirtualHost>
>      >>>
>      >>> I hope this clarifies. I will skim through the addon link you
>     sent me
>      >>> though.
>      >>
>      >>
>      >>
>      >> If I were to do this, I would use a simple config pre-processor to
>      >> substitute out the variables.  That is a robust, simple, and
>      >> easy-to-impliment solution.
>      >>
>      >> I believe that you can actually use env-variables in httpd.conf
>     using
>      >> something like ${env-variable}; but this is undocumented and perhaps
>      >> fragile.
>      >
>      >
>      >
>      > That would make sense. Or using some apache internal variable
>     would suit
>      > as well. In my case there are only two distinct variables for
>     each site,
>      > that should be used in VirtualHost, ServerAlias and sometimes in the
>      > logs definitions.
>      >
>      > I'd like to keep config preprocessors as a last resort solution...
>      >
>      >
>      > Bye
>      > Bgs
> 
>     ---------------------------------------------------------------------
>     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
>     <ma...@httpd.apache.org>
>        "   from the digest: users-digest-unsubscribe@httpd.apache.org
>     <ma...@httpd.apache.org>
>     For additional commands, e-mail: users-help@httpd.apache.org
>     <ma...@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


Re: [users@httpd] Dynamic config parameters

Posted by Antoine Prevosto <an...@gmail.com>.
May be you could also share common configuration files between your
load-balanced servers, and "Include" configuration files whit directives
specific to each one.

That is the way I work with my servers, so maintenance is kept easy (no
preprocessor, no envvar).

Brgds
Antoine.

2006/4/6, Bgs <bg...@bgs.hu>:
>
>
> Just for the records: I had to choose the preprocessor version.
>
> Bgs wrote:
> >>> <VirtualHost %IP>
> >>>  ServerName domain.com
> >>>  ServerAlias www.domain.com web%NUM.domain.com
> >>> ...
> >>> </VirtualHost>
> >>>
> >>> I hope this clarifies. I will skim through the addon link you sent me
> >>> though.
> >>
> >>
> >>
> >> If I were to do this, I would use a simple config pre-processor to
> >> substitute out the variables.  That is a robust, simple, and
> >> easy-to-impliment solution.
> >>
> >> I believe that you can actually use env-variables in httpd.conf using
> >> something like ${env-variable}; but this is undocumented and perhaps
> >> fragile.
> >
> >
> >
> > That would make sense. Or using some apache internal variable would suit
> > as well. In my case there are only two distinct variables for each site,
> > that should be used in VirtualHost, ServerAlias and sometimes in the
> > logs definitions.
> >
> > I'd like to keep config preprocessors as a last resort solution...
> >
> >
> > Bye
> > Bgs
>
> ---------------------------------------------------------------------
> 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] Dynamic config parameters

Posted by Bgs <bg...@bgs.hu>.
Just for the records: I had to choose the preprocessor version.

Bgs wrote:
>>> <VirtualHost %IP>
>>>  ServerName domain.com
>>>  ServerAlias www.domain.com web%NUM.domain.com
>>> ...
>>> </VirtualHost>
>>>
>>> I hope this clarifies. I will skim through the addon link you sent me
>>> though.
>>
>>
>>
>> If I were to do this, I would use a simple config pre-processor to
>> substitute out the variables.  That is a robust, simple, and
>> easy-to-impliment solution.
>>
>> I believe that you can actually use env-variables in httpd.conf using
>> something like ${env-variable}; but this is undocumented and perhaps
>> fragile.
> 
> 
> 
> That would make sense. Or using some apache internal variable would suit 
> as well. In my case there are only two distinct variables for each site, 
> that should be used in VirtualHost, ServerAlias and sometimes in the 
> logs definitions.
> 
> I'd like to keep config preprocessors as a last resort solution...
> 
> 
> Bye
> Bgs

---------------------------------------------------------------------
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] Dynamic config parameters

Posted by Bgs <bg...@bgs.hu>.
>><VirtualHost %IP>
>>  ServerName domain.com
>>  ServerAlias www.domain.com web%NUM.domain.com
>>...
>></VirtualHost>
>>
>>I hope this clarifies. I will skim through the addon link you sent me
>>though.
> 
> 
> If I were to do this, I would use a simple config pre-processor to
> substitute out the variables.  That is a robust, simple, and
> easy-to-impliment solution.
> 
> I believe that you can actually use env-variables in httpd.conf using
> something like ${env-variable}; but this is undocumented and perhaps
> fragile.


That would make sense. Or using some apache internal variable would suit 
as well. In my case there are only two distinct variables for each site, 
that should be used in VirtualHost, ServerAlias and sometimes in the 
logs definitions.

I'd like to keep config preprocessors as a last resort solution...


Bye
Bgs

---------------------------------------------------------------------
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] Dynamic config parameters

Posted by Joshua Slive <jo...@slive.ca>.
On 4/3/06, Bgs <bg...@bgs.hu> wrote:

> What I have:
>
> Several frontends, with different IPs. They hold several vhosts and are
> loadbalanced. So they have virtualhost entries for an external IP, the
> main fqdn for the specific site, and some aliases including a
> webXX.domain.com stile name for testing individual frontends... (for
> example web01.domain.com, web02.domain.com, etc.).
>
> They only differ in their IP and the XX in webXX. I'd like to have a
> main configuration (possibly included from a network share) for all
> frontends. So my config would look simething like:
>
> <VirtualHost %IP>
>   ServerName domain.com
>   ServerAlias www.domain.com web%NUM.domain.com
> ...
> </VirtualHost>
>
> I hope this clarifies. I will skim through the addon link you sent me
> though.

If I were to do this, I would use a simple config pre-processor to
substitute out the variables.  That is a robust, simple, and
easy-to-impliment solution.

I believe that you can actually use env-variables in httpd.conf using
something like ${env-variable}; but this is undocumented and perhaps
fragile.

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] Dynamic config parameters

Posted by Bgs <bg...@bgs.hu>.
  Thanks for you reply! :)

>>>I have multiple webservers wich are loadbalanced. They only differ in
>>>their IP and a unique virtualhost used for testing.
>>>(site.com/www.site.com is common, web01.site.com is unique).
>>>
>>>Is there a way to create az includable config in which these numbers are
>>>dynamic parameters?
>>>
>>>Like: <VirtualHost %I>
>>>Where %I is the IP number (take from where?). Or is it possible to use
>>>some environment variable?
> 
> 
> It's not possible in general with the default server.
> 
> It is possible:
> 1. Using third-party modules available from http://modules.apache.org/
> 2. Using a config pre-processor like m4
> 3. In many specific cases using the default modules, but you'd need to
> specify exactly what kinds of configs you need.

What I have:

Several frontends, with different IPs. They hold several vhosts and are 
loadbalanced. So they have virtualhost entries for an external IP, the 
main fqdn for the specific site, and some aliases including a 
webXX.domain.com stile name for testing individual frontends... (for 
example web01.domain.com, web02.domain.com, etc.).

They only differ in their IP and the XX in webXX. I'd like to have a 
main configuration (possibly included from a network share) for all 
frontends. So my config would look simething like:

<VirtualHost %IP>
  ServerName domain.com
  ServerAlias www.domain.com web%NUM.domain.com
...
</VirtualHost>

I hope this clarifies. I will skim through the addon link you sent me 
though.

Bye
Bgs



> 
> 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] Dynamic config parameters

Posted by Joshua Slive <jo...@slive.ca>.
On 4/3/06, Bgs <bg...@bgs.hu> wrote:
>
>   Hm.... no reaction :/
>
>   Does this mean that it's so trivial or that it's not possible? :)
>
> Bgs wrote:
> >
> >  Hi all,
> >
> >
> > I couldn't find info on this subject...
> >
> > I have multiple webservers wich are loadbalanced. They only differ in
> > their IP and a unique virtualhost used for testing.
> > (site.com/www.site.com is common, web01.site.com is unique).
> >
> > Is there a way to create az includable config in which these numbers are
> > dynamic parameters?
> >
> > Like: <VirtualHost %I>
> > Where %I is the IP number (take from where?). Or is it possible to use
> > some environment variable?

It's not possible in general with the default server.

It is possible:
1. Using third-party modules available from http://modules.apache.org/
2. Using a config pre-processor like m4
3. In many specific cases using the default modules, but you'd need to
specify exactly what kinds of configs you need.

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