Hi Paul and everyone,

> This is something that CERN had that I always thought would be very very
> useful, but never got around to implement it (it is quite non-trival to
> do).
> 
> You can emulate it (not very satisfactorally) by using "Include" inside
> the <Directory> sections. Perhaps better approach would be to allow for
> "user-defined" directives or macros, such as
> 
> <DefineMacro RestrictRemoteUsers>
>   order ...
>   deny ...
>   allow ...
> </DefineMacro>
> 
> which can then be used by name:
> 
> <Directory>
>   UseMacro RestrictRemoteUsers
> </Directory>
> 
> This could the be used for grouping any directives that may need to be
> repeated.

I saw sometime ago a related proposal in new-httpd, not only with macros but
control structures, etc
What was argued then (from the top of my head, i do not seem to be able to
find it again) is that the drawback is that if you have some kind of
conditional structure, or programmatic conf file, then it is very difficult
for a GUI to be able to parse it properly. I agree with that but I would enjoy
having a better configuration language that it is user and GUI friendly.

In brief, something like inheritance would be nice but complex macros or
sections that allow something like:

if some_test_here then {

  foreach $vhost do { ... }

} else {

<virtualhost www.foo.bar>
...
</virtual>

}

> This should really be discussed on new-httpd, though, since this is about
> altering the Apache configuration language itself, rather than layering
> a GUI on top of what is already available.

Inheritance in configuration directives:
It was just an idea I was thinking about for some time, but my knowledge of
Apache internals is close to zero, so I think you are in a much better
position to implement/propose it in new-httpd if you find the idea could be
useful.

Programmatic conf files (macros, control structures...) are also a powerful
tool, but I do not think they should be part of the configuration files
syntax but instead, could be implemented with some kind of template system
(embedded perl or something) that would output the actual .conf files that
Apache would read

Best regards

Daniel

-- 
Daniel           [EMAIL PROTECTED]


Reply via email to