You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2015/08/30 19:01:19 UTC

[Bug 58304] New: Unexpected Warnings from Macro Use in 2.4

https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

            Bug ID: 58304
           Summary: Unexpected Warnings from Macro Use in 2.4
           Product: Apache httpd-2
           Version: 2.4.16
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
          Assignee: bugs@httpd.apache.org
          Reporter: tom.browder@gmail.com

Starting with 2.4.12 and still existing in 2.4.16, when using a Macro
definition for virtual hosts, I get repeated warnings to stdout that the macro
variables are undefined every time apache is started or during a syntax check: 

root@dedi2:/home/tbrowde# apachectl -t
[Sun Aug 30 16:39:35.097827 2015] [core:warn] [pid 4101:tid 140105241839360]
AH00111: Config variable ${PROJECT} is not defined
[Sun Aug 30 16:39:35.097911 2015] [core:warn] [pid 4101:tid 140105241839360]
AH00111: Config variable ${TLD} is not defined
[Sun Aug 30 16:39:35.098007 2015] [core:warn] [pid 4101:tid 140105241839360]
AH00111: Config variable ${PROJECT} is not defined
[Sun Aug 30 16:39:35.098021 2015] [core:warn] [pid 4101:tid 140105241839360]
AH00111: Config variable ${TLD} is not defined
[Sun Aug 30 16:39:35.098562 2015] [core:warn] [pid 4101:tid 140105241839360]
AH00111: Config variable ${PROJECT} is not defined
[Sun Aug 30 16:39:35.098575 2015] [core:warn] [pid 4101:tid 140105241839360]
AH00111: Config variable ${TLD} is not defined
[Sun Aug 30 16:39:35.098889 2015] [core:warn] [pid 4101:tid 140105241839360]
AH00111: Config variable ${PROJECT} is not defined
[Sun Aug 30 16:39:35.098904 2015] [core:warn] [pid 4101:tid 140105241839360]
AH00111: Config variable ${TLD} is not defined
Syntax OK

I am using three macros that are defined in the httpd.conf file as follows:

<Macro VHOST_NONTLS ${PROJECT} ${TLD}>
  <VirtualHost *:80>
    ServerName  ${PROJECT}.${TLD}
    ServerAlias *.${PROJECT}.${TLD}
    DocumentRoot /home/web-server/${PROJECT}.${TLD}/public
  </VirtualHost>
</Macro>
Use VHOST_NONTLS niceville.pm          org
UndefMacro VHOST_NONTLS

<Macro VHOST_FREE_CERT_TLS ${PROJECT} ${TLD}>
  <VirtualHost *:80>
    ServerName  ${PROJECT}.${TLD}
    ServerAlias *.${PROJECT}.${TLD}
    # enforce ssl/tls
    Redirect Permanent / https://${PROJECT}.${TLD}/
  </VirtualHost>
</Macro>
Use VHOST_FREE_CERT_TLS  computertechnwf  org
UndefMacro VHOST_FREE_CERT_TLS

<Macro VHOST_WILDCARD_TLS ${PROJECT} ${TLD}>
  <VirtualHost *:80>
    ServerName  ${PROJECT}.${TLD}
    ServerAlias *.${PROJECT}.${TLD}
    # enforce ssl/tls
    Redirect Permanent / https://${PROJECT}.${TLD}/
  </VirtualHost>
  # ...
</Macro>
Use VHOST_WILDCARD_TLS highlandsprings61     org
UndefMacro VHOST_WILDCARD_TLS

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 58304] Unexpected Warnings from Macro Use in 2.4

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

--- Comment #3 from Darren Embry <ds...@gmail.com> ---
This fix appears to have been in Apache 2 for quite some time.

I'm marking RESOLVED/Fixed.

This appears to remedy bug 59299.

I've filed bug 66153 related to the mod_macro documentation.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 58304] Unexpected Warnings from Macro Use in 2.4

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

--- Comment #1 from Marc Stern <ma...@approach.be> ---
${VAR} is interpreted as a defined variable
(http://httpd.apache.org/docs/2.4/mod/core.html#define). It's equivalent to
%{VAR}.

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 clashes with the Define directive, so it should be changed. Ans
%{var} clashes with mod_rewrite.

This doe not only give a warning but could lead to a real mismatch between
something defined as a local parameter and somebody else defining it at a
global level as a defined config variable.

To make interpolation not clash with another module, we should use another
character (instead of an existing one or on top of?) like &{var}.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 58304] Unexpected Warnings from Macro Use in 2.4

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

Ryan Ollos <rj...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rjollos@apache.org

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 58304] Unexpected Warnings from Macro Use in 2.4

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

Marc Stern <ma...@approach.be> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2.4.16                      |2.4.20

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 58304] Unexpected Warnings from Macro Use in 2.4

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

Marc Stern <ma...@approach.be> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2.4.20                      |2.5-HEAD
                 OS|Linux                       |All
           Hardware|PC                          |All

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 58304] Unexpected Warnings from Macro Use in 2.4

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

Tom Browder <to...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tom.browder@gmail.com

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 58304] Unexpected Warnings from Macro Use in 2.4

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

Darren Embry <ds...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 58304] Unexpected Warnings from Macro Use in 2.4

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

--- Comment #2 from Marc Stern <ma...@approach.be> ---
Created attachment 34013
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34013&action=edit
Add warning about syntax clash

In case a macro argument uses the syntax ${...}, adds a warning that it clashes
with the 'Define' directive

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 58304] Unexpected Warnings from Macro Use in 2.4

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58304

Christophe JAILLET <ch...@wanadoo.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|Core                        |mod_macro

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org