mod-macro ... Re: [PLUG] variables in apache

Keith Lofstrom keithl at kl-ic.com
Sun May 20 05:06:19 UTC 2007


On Sat, May 19, 2007 at 09:08:24PM -0700, Kurt Sussman wrote:
> Keith Lofstrom (keithl at kl-ic.com) typed this ...
> > 1) Is it possible to define a user variable near the start of
> > http.conf, and use it later on?  For example:
> 
> No. Unless you use some external macro processor.
> 
> > 2) Is it possible to take whole chunks of configuration and make
> > parameterized macros out of them?  For example:
> 
> Yes, mod_macro can do this for you. You could build macros that
> encapsulate your IP, though you probably couldn't cover every base that
> way. It's perfect for building virtual hosts if you can't make them all
> the same.

mod_macro (http://www.cri.ensmp.fr/~coelho/mod_macro/) looks like 
just the thing - and in my case I can encapsulate the IP addresses
in macros.

Unfortunately, it requires recompiling httpd, which interferes with
yum upgrades of the main httpd code.  The "m4" approach that Paul
suggested will work without changing httpd, but I would have to make
sure that everyone connected with the system worked through the m4
macro process, rather than directly editing httpd.conf .  I third
approach would be to build a Perl script with some embedded HERE
documents.

I will probably go the m4 route for now (I've used m4 since 1981, 3BSD
on a vax 11/780 ), but I will code with an eye towards mod_macro,
which I hope will become part of the main httpd package soon, which
means I can use an upgradable httpd with macro capability.

Keith

-- 
Keith Lofstrom          keithl at keithl.com         Voice (503)-520-1993
KLIC --- Keith Lofstrom Integrated Circuits --- "Your Ideas in Silicon"
Design Contracting in Bipolar and CMOS - Analog, Digital, and Scan ICs



More information about the PLUG mailing list