httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabien COELHO <coe...@cri.ensmp.fr>
Subject Re: FW: general/3563: I want to allow the definition and use of macros within runtime configuration files.
Date Mon, 21 Dec 1998 16:56:42 GMT

Hi,

> We should avoid the temptation to let add this and that to the
> configuration files until we can lay on general fix to the beasts.
>
> Nobody would argue that the configuration are not very verbose,
> somewhat delicate, and full of uninteresting chaff - that they
> need some abstraction to fix that.
> 
> The argument is where to get that abstraction.  In the short
> term the usual ways (m4/perl/awk/sed/cpp, etc. etc.) are mighty 
> powerful.  In the long term the current consensus is to get
> good abstraction from an XML notation, declaration, and GUI editing 
> tools written by other parties.

Sure. You can address the meta problem, but I have just practical problems
right now that I needed to solve. I do not think that I'm the only one
with such problems, hence my request for adding the feature and sharing
it.

Also I tried to explain why cpp/m4 can't work properly with apache
configuration files, so they are NOT "short term powerful fixes" as you
put it. Both these are rather "general powerfull tools" that happend not
to be powerfull enough to handle apache lack of general lexical
conventions in configuration files. I mean when you try to use them not an
abstract level "one can do it" but at a concrete level "let's try to use
it now". 

For instance with CPP:

#define allowing(ip) \
# let's define default access \
Order deny,allow \
Deny from all \
Allow from dnl.ensmp.fr ip

allowing(10.2.16.0/24)

you get :

# let's define default access Order deny,allow Deny from all Allow from dnl.ensmp.fr 10.2.16.0/8

one **ONE** line. so cpp is just USELESS if you need macro that span over
one line. this is because cpp assumes C lexical conventions, where
newlines are not important. 


Another example with M4:

define(`allowing',`
# let's define default access
Order deny,allow
Deny from all
Allow from dnl.ensmp.fr $1
')

allowing(10.2.16.0/24)

Looks good? No. It is broken because:

(1) there is ' in the comment, so it is the end of the `
    - let us remove the '

(2) the define m4 keyword is used within a the comment.
    - let us remove define

(3) the machine is named dnl... but this means "delete line" for m4.
    - let us rename the machine;-)

... 

I won't argue for or against perl sections: They change configuration
habits a lot too much for me.

Any preprocessor *needs* lexical conventions. With apache they must me
minimal: independent "\"-continued-lines. 

I added the perfectible macro module, because neither m4 nor cpp nor
perl seemed proper solutions to me. 

> The usual hill climbing - scratch the itch - make it better
> step by step approach needs to bear that long term goal in
> mind.  The XML community is doing lots of stuff, but is macros
> one of them?

I agree with your long terms goals. But I have thousand lines of apache 
configuration files to maintain, and that is my problem right now;-)
I'll be happy with apache 2+ with its neat xml (sgml?) abstractions,
when it comes.

Fabien.

Mime
View raw message