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

http://people.apache.org/~rjung/mod_define/mod_define-current-src.tar.gz

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

Regards,

Rainer

Reply via email to