1

I have a website with the following configuration:

<VirtualHost *:80>
    ServerName example.it

<Location />
    SetHandler uwsgi-handler
    uWSGISocket /var/sitedir/moin.sock
</Location>

<Location /piwik/>
    SetHandler application/x-httpd-php
</Location>

<Directory "/var/piwik/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Require all granted
    SetHandler application/x-httpd-php
</Directory>

Alias /piwik/ "/var/piwik/"

</VirtualHost>

... including a moinmoin wiki and a Matomo instance; but since some system upgrade, when I visit http://example.it/piwik, I get the source of the index.php file inside /var/piwik/ - it is not executed.

I know this suggests of some php problem - but if I remove the two Location sections, Matomo works just fine at http://example.it/piwik (Moinmoin clearly stops working). So it is really a problem of this configuration. If instead I only remove the second Location section (Matomo's one), then http://example.it/piwik is served by uwsgi (Moinmoin).

So summing up,

  1. If the only section is Matomo's Directory section, then its SetHandler directive does its job.
  2. If /piwik/ doesn't have its own Location, then the SetHandler inside its Directory section is not honored: this is as expected, since Location sections should have priority over Directory sections.
  3. However, if /piwik/ does have its own Location, then its SetHandler statement should be honored, because it comes later. And in fact, something happens, because the request is not served by uwsgi. But it's not served as php either.

What is going wrong? Notice that I'm sure Moinmoin and Matomo worked both fine before a system upgrade, and while I'm not sure anymore how exactly the config file was, I'm pretty sure I tried all the combinations including the one that used to work.

EDIT: related, but does not explain my problem: How does Apache merge multiple matching Location sections

  • probably a dumb question, but should there be a trailing / in the *Alias /piwik* bit ?(*Alias /piwik/ "/var/piwik/"*). If not, I'll back away slowly into the hedge now... – Smock Jul 22 '20 at 18:19
  • Smock, I _think_ you are perfectly right, and I edited the config file above accordingly (removing the / was some failed experiment of mine)... but the problem unfortunately remains. – Pietro Battiston Jul 22 '20 at 21:24
  • Ahh :-/ worth a shot :( – Smock Jul 23 '20 at 20:09

0 Answers0