httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Gearls <nickgea...@gmail.com>
Subject Re: Unexpected Warnings from Macro Use in 2.4
Date Thu, 19 Feb 2015 13:02:10 GMT
Wrong answer: mod_macro uses the syntax $var but also ${var}, which is 
mandatory if you want the variable to be a part of a string, like in 
"${var}abc".
The syntax really clashes with the Define directive, so it should be 
changed.
Another unused character could be used, like ยง


On 18-02-2015 19:53, Gregg Smith wrote:
> 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