httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <>
Subject Re: svn commit: r904768 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/core.xml server/core.c
Date Sun, 31 Jan 2010 11:56:47 GMT
On 31.01.2010 12:19, Stefan Fritsch wrote:
> On Sat, 30 Jan 2010, Rainer Jung wrote:
>> I ported mod_define to 2.0/2.2 a few years ago. You can have a look at
>> It was originally written by Ralf S. Engelschall and distributed as
>> part of the mod_ssl distribution for Apache 1.3. After approval by
>> Ralf I published the port under the AL 2.0.
> That's exactly what I wanted. Would be possible to ship it with httpd by
> default?

Yes, of course.

For all followers of this discussion:

mod_define allows to define variables in Apache configuration. The major 
difference to the already existing interpolation of "real" environment 
variables is, that you can change your configuration and get the new 
values by e.g. a graceful restart. No need to fully stop the server as 
with real environment variables.

It also allows to adopt the variable definition and referencing syntax 
to possibly conflicting uses, e.g. to make it compatibly with mod_macro.

Typical uses are templating, e.g. if you want to use an analogous 
configuration on all nodes of a farm, but there are some small changes 
like the name of the farm nodes inside the log file names, or the listen 
IP addres. You can easily refactor those out of the configuration and 
keep them in a small included file with the definitions for mod_define. 
That way most of the config files stay identical over the farm nodes.

Another use case is refactoring directory pathes out of the config.

The module isn't in conflict with mod_macro, because mod_macro allows 
you to esily reuse blocks of configuration directives your are going to 
use multiple times in your configuration, mod_define allows you to reuse 
values (so it is similr to functions and variables).



View raw message