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 2014/04/28 14:04:03 UTC

[Bug 56466] New: issue with mod_macro parser

https://issues.apache.org/bugzilla/show_bug.cgi?id=56466

            Bug ID: 56466
           Summary: issue with mod_macro parser
           Product: Apache httpd-2
           Version: 2.4.9
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Other Modules
          Assignee: bugs@httpd.apache.org
          Reporter: seyhun_cavus@hotmail.com

Intro: Today, I was clearing the configuration file of Apache HTTPD and before
doing this I have upgraded Apache HTTPD to the latest version (2.4.9) to be
able to use unix socket option.
But, I've faced some crushes while I clear the configuration file. Fortunately,
I've found the source of the issue but it was really hard for me to detect it
since I had also done more tuning operations today.
So, I was not sure about the bug, and now I am.

The source of the issue is mod_macro. May it is a bug or maybe it does not work
as I have supposed to be.
Crush logs are long. So, I am posting other footprints instead.

Footprint 1:
[Mon Apr 28 11:38:51.217549 2014] [macro:warn] [pid 16400:tid 140305156634368]
macro 'modenull' multiply defined: \xa0\x92B, redefined on line 559 of
"/etc/httpd/httpd.conf"
[Mon Apr 28 11:37:01.830618 2014] [macro:warn] [pid 15815:tid 140126534055680]
macro 'modenull' multiply defined: defined on line 559 of
"/etc/httpd/httpd.conf", redefined on line 559 of "/etc/httpd/httpd.conf"
- I actually did not redefine macros.

Footprint 2:
AH00082: an unknown filter was not added: reqtimeout
- mod_reqtimeout was actually loaded.

Footprint 3:
AH01797: client denied by server configuration: /srv/www/
- mod_access_compat has access already.

And so on... It just breaks loading of other listed modules.
This is what I've used as macro definitions.

-----------------------------------------------------

Define  root_www   /srv/www/
Define  root_ssl   /etc/ssl/certs/

<Macro ConnectionDefault $id>
# noting to do
</Macro>

<Macro ModeNull $id>
# mod_php: noting to do
</Macro>

<Macro ModePHPFPM $id>
    ProxyPassMatch ^/(.*\.php)$
unix:/var/run/php-fpm.sock|fcgi://127.0.0.1:9000${root_www}/$id/@g
</Macro>

<Macro ModeHHVM $id>
    ProxyPassMatch ^/(.*\.php)$
unix:/var/run/hhvm/hhvm.sock|fcgi://127.0.0.1:9000${root_www}/$id/@g
</Macro>

<Macro ConnectionSSL $id>
    SSLEngine On
    SSLCertificateFile    "${root_ssl}$id.crt"
    SSLCertificateKeyFile "${root_ssl}$id.key"
    SSLCACertificateFile  "${root_ssl}ca-certificates.crt"
</Macro>

<Macro VHost $id $mode $port $connection $name $alias>
    <VirtualHost *:$port>
        ServerName   $name
        ServerAlias  $alias

        Use Connection$connection $id

        DocumentRoot "${root_www}/$id/"
        <Directory "${root_www}/$id/">
            IncludeOptional ${root_www}/$id/.htaccess
            AllowOverride None
            Allow from all
        </Directory>
        ErrorLog /var/log/httpd/$id/error.log
        CustomLog /var/log/httpd/$id/access.log combined

        Use Mode$mode $id
    </VirtualHost>
</Macro>

# Use VHost example Null   80  Default example.com www.example.com
# Use VHost example PHPFPM 443 SSL     example.com www.example.com
# Use VHost example HHVM   80  Default example.com www.example.com

UndefMacro ConnectionDefault
UndefMacro ConnectionSSL
UndefMacro ModeNull
UndefMacro ModePHPFPM
UndefMacro ModeHHVM
UndefMacro VHost

-----------------------------------------------------

-- 
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 56466] issue with mod_macro parser

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

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |INVALID

--- Comment #2 from Eric Covener <co...@gmail.com> ---
Thanks for followup, remarking as invalid rather than fixed (= fixed in httpd)

-- 
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 56466] issue with mod_macro parser

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

seyhun <se...@hotmail.com> changed:

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

--- Comment #1 from seyhun <se...@hotmail.com> ---
OK, I can confirm that the source of the issue has been totally my mistake !

After reading the mod_macro documentation carefully, I have changed $ prefixes
to %{} to avoid confusion and that has just solved the problem.

Now, the macros are as following;

[Hopefully, this posts may help to users who face this or similar problem.]

-------------------------------------------------------------------------------
# BEGIN MACROS
#
# http://httpd.apache.org/docs/current/mod/core.html#define
# https://httpd.apache.org/docs/current/en/mod/mod_macro.html
# http://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI
#

Define  root_www   /srv/www/
Define  root_ssl   /etc/ssl/certs/

<Macro ConnectionDefault %{id}>
# nothing to do
    ErrorLog /var/log/httpd/%{id}/error.log
</Macro>

<Macro ModeNull %{id}>
# mod_php: nothing to do
    ErrorLog /var/log/httpd/%{id}/error.log
</Macro>

<Macro ModePHPFPM %{id}>
    ProxyPassMatch ^/(.*\.php)$
unix:/var/run/php-fpm/php-fpm.sock|fcgi://127.0.0.1:9000${root_www}/%{id}
</Macro>

<Macro ModeHHVM %{id}>
    ProxyPassMatch ^/(.*\.php)$
unix:/var/run/hhvm/hhvm.sock|fcgi://127.0.0.1:9000${root_www}/%{id}
</Macro>

<Macro ConnectionSSL %{id}>
    SSLEngine On
    SSLCertificateFile    "${root_ssl}%{id}.crt"
    SSLCertificateKeyFile "${root_ssl}%{id}.key"
    SSLCACertificateFile  "${root_ssl}ca-certificates.crt"
    ErrorLog /var/log/httpd/%{id}/error.log
</Macro>

<Macro VHost %{id} %{mode} %{port} %{connection} %{name} %{alias}>
    <VirtualHost *:%{port}>
        ServerName  %{name}
        ServerAlias %{alias}

        Use Connection%{connection} %{id}

        DocumentRoot "${root_www}/%{id}/"
        <Directory "${root_www}/%{id}/">
            IncludeOptional ${root_www}/%{id}/.htaccess
            AllowOverride None
            Allow from all
        </Directory>
        CustomLog /var/log/httpd/%{id}/access.log combined
        ErrorLog /var/log/httpd/%{id}/error.log

        Use Mode%{mode} %{id}
    </VirtualHost>
</Macro>

# Use VHost example Null   80  Default example.com www.example.com
# Use VHost example PHPFPM 443 SSL     example.com www.example.com
# Use VHost example HHVM   80  Default example.com www.example.com

UndefMacro ConnectionDefault
UndefMacro ConnectionSSL
UndefMacro VHost
UndefMacro ModeNull
UndefMacro ModePHPFPM
UndefMacro ModeHHVM

# END MACROS
-------------------------------------------------------------------------------

-- 
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