httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregg Smith <...@gknw.net>
Subject Re: Unexpected Warnings from Macro Use in 2.4
Date Wed, 18 Feb 2015 18:53:32 GMT
On 2/18/2015 6:12 AM, Tom Browder wrote:
> I have been using mod_macro for some time and always get the following
> types of messages on startup (using 2.4.12 now, but this behavior has
> been noticed since 2.4.7):
>
> [Wed Feb 18 13:54:55.019032 2015] [core:warn] [pid 970:tid
> 140069833443200] AH00111: Config variable ${PROJECT} is not defined
> [Wed Feb 18 13:54:55.019041 2015] [core:warn] [pid 970:tid
> 140069833443200] AH00111: Config variable ${TLD} is not defined
>
> For the example httpd instance only one macro is defined, used, and
> undefined like this:
>
> <Macro VHOST_NONTLS ${PROJECT} ${TLD}>
>   <VirtualHost *:80>
>      ServerName  ${PROJECT}.${TLD}
>      ServerAlias www.${PROJECT}.${TLD}
>      DocumentRoot /home/web-sites/${PROJECT}.${TLD}/public
>    </VirtualHost>
> </Macro>
> Use VHOST_NONTLS mysite      org
> UndefMacro VHOST_NONTLS
>
> The warnings I believe are spurious and should not be there.  The
> virtual hosts work fine after startup.  Apparently, the first time
> though the macro definitions are read and, since they are not defined,
> the warnings are produced.  It seems to me that is a bug.
>
> Am I doing something wrong?
Probably because ${VAR} is used when defining variables in the config, 
like ServerRoot is.
http://httpd.apache.org/docs/2.4/mod/core.html#define

mod_macro uses just $var so just remove the braces in your above example.
http://httpd.apache.org/docs/2.4/mod/mod_macro.html

Mime
View raw message