You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Tom Browder <to...@gmail.com> on 2015/08/22 18:16:44 UTC

Re: Unexpected Warnings from Macro Use in 2.4

On Tue, Feb 24, 2015 at 7:15 AM, Tom Browder <to...@gmail.com> wrote:
>
> On Feb 24, 2015 6:52 AM, "Nick Gearls" <ni...@gmail.com> wrote:
>>
>> Define mysite   www.mycompany.com
>>
>> <Macro NewSite $mysite>
>>  Servername${mysite}
>>  ErrorLog /var/log/httpd/${mysite}_error.log
>> </Macro>
>>
>> Use NewSite www.company1.com
>> Use NewSite www.company2.com
>
> That's similar to the way I use it for multiple virtual hosts and have no
> problems except the warnings I reported.

The problem still exists in 2.4.16.  Shall I file a bug?

-Tom

Re: Fwd: Unexpected Warnings from Macro Use in 2.4

Posted by Eric Covener <co...@gmail.com>.
On Mon, Aug 24, 2015 at 11:21 AM, Rainer Jung <ra...@kippdata.de> wrote:
> think it would be better if httpd core (${x}) and mod_rewrite (%{x}) could
> stay as-is and mod_macro would support yet another prefix like "&".

+1


-- 
Eric Covener
covener@gmail.com

Re: Fwd: Unexpected Warnings from Macro Use in 2.4

Posted by Rainer Jung <ra...@kippdata.de>.
Am 24.08.2015 um 13:40 schrieb Nick Gearls:
> This is definitely a bug as we have a major incompatibility between two
> features.
> Remark: although mod_macro can use $ and % for unescaped characters,
> ${x} is used by Define and %{x} by mod_rewrite :-(

Shooting from the hip:

     &{x}

Haven't checked for implications, but adding "&" to mod_macro with the 
same meaning as "$" and "%" looks trivial to do.

> I suppose the preferred solution to not be incompatible with the current
> situation would be an optional directive to overwrite the $ character
> (DefineChar?)

I think it would be better if httpd core (${x}) and mod_rewrite (%{x}) 
could stay as-is and mod_macro would support yet another prefix like 
"&". Note that there is already support for @{x}, but that has slightly 
different semantics (which doesn't matter in many cases).

Another thing: apart from us providing better and unambiguous syntax, it 
would always be a good idea not to use the same names for macro 
variables and system environment resp. Define variables in your 
configuration. Otherwise chances are good someone (admin) or something 
(software) will misinterpret what actually happens or should happen.

Regards,

Rainer


> -------- Forwarded Message --------
> Subject:     Re: Unexpected Warnings from Macro Use in 2.4
> Date:     Sat, 22 Aug 2015 11:16:44 -0500
> From:     Tom Browder <to...@gmail.com>
> To:     nickgearls@gmail.com, dev@httpd.apache.org <de...@httpd.apache.org>
>
>
> On Tue, Feb 24, 2015 at 7:15 AM, Tom Browder <to...@gmail.com> wrote:
>>
>> On Feb 24, 2015 6:52 AM, "Nick Gearls" <ni...@gmail.com> wrote:
>>>
>>> Define mysite   www.mycompany.com
>>>
>>> <Macro NewSite $mysite>
>>>  Servername${mysite}
>>>  ErrorLog /var/log/httpd/${mysite}_error.log
>>> </Macro>
>>>
>>> Use NewSite www.company1.com
>>> Use NewSite www.company2.com
>>
>> That's similar to the way I use it for multiple virtual hosts and have no
>> problems except the warnings I reported.
>
> The problem still exists in 2.4.16.  Shall I file a bug?
>
> -Tom

Re: Unexpected Warnings from Macro Use in 2.4

Posted by Eric Covener <co...@gmail.com>.
On Mon, Aug 24, 2015 at 7:40 AM, Nick Gearls <ni...@gmail.com> wrote:
> Remark: although mod_macro can use $ and % for unescaped characters, ${x} is
> used by Define and %{x} by mod_rewrite :-(

Just to make sure it's clear, ${x} is even older then Define and is
used to resolve real native environment variables.

Re: Unexpected Warnings from Macro Use in 2.4

Posted by Tom Browder <to...@gmail.com>.
On Mon, Aug 24, 2015 at 6:40 AM, Nick Gearls <ni...@gmail.com> wrote:
> This is definitely a bug as we have a major incompatibility between two
> features.

I have filed bug report ID 58304.

-Tom

Fwd: Unexpected Warnings from Macro Use in 2.4

Posted by Nick Gearls <ni...@gmail.com>.
This is definitely a bug as we have a major incompatibility between two 
features.
Remark: although mod_macro can use $ and % for unescaped characters, 
${x} is used by Define and %{x} by mod_rewrite :-(

I suppose the preferred solution to not be incompatible with the current 
situation would be an optional directive to overwrite the $ character 
(DefineChar?)

-------- Forwarded Message --------
Subject: 	Re: Unexpected Warnings from Macro Use in 2.4
Date: 	Sat, 22 Aug 2015 11:16:44 -0500
From: 	Tom Browder <to...@gmail.com>
To: 	nickgearls@gmail.com, dev@httpd.apache.org <de...@httpd.apache.org>


On Tue, Feb 24, 2015 at 7:15 AM, Tom Browder <to...@gmail.com> wrote:
>
> On Feb 24, 2015 6:52 AM, "Nick Gearls" <ni...@gmail.com> wrote:
>>
>> Define mysite   www.mycompany.com
>>
>> <Macro NewSite $mysite>
>>  Servername${mysite}
>>  ErrorLog /var/log/httpd/${mysite}_error.log
>> </Macro>
>>
>> Use NewSite www.company1.com
>> Use NewSite www.company2.com
>
> That's similar to the way I use it for multiple virtual hosts and have no
> problems except the warnings I reported.

The problem still exists in 2.4.16.  Shall I file a bug?

-Tom