• Resolved chtoller

    (@chtoller)


    Hi there,
    we are just configuring the Matomo Plugin and found that our IP is blocked by the webserver after a few clicks in the Matomo admin pages in the WordPress backend.

    It took me a while to find that the Matomo backend tries to access /wp-content/plugins/matomo/app/config/global.ini.php, even though that is forbidden by the .htaccess file in /wp-content/plugins/matomo/

    The file itself contains the warning NOT to modify it but to contact Matomo in case of issues. As I consider this more likely to be a plugin issue, I’m posting this here.

    The issue can be reproduced easily. Config: WP 6.1.1, Matomo Plugin 4.13.5, Twenty TwentyTwo theme, no other plugins active, PHP 8.0
    Every attempt to access Matomo Analytics / First steps causes the following error in the apache error_log:

    [Tue Mar 14 21:11:59.402619 2023] [authz_core:error] [pid 1607997] [client 94.16.33.171:0] AH01630: client denied by server configuration: /var/www/vhosts/hoeckner.com/staging.hoeckner.com/wp-content/plugins/matomo/app/config/global.ini.php, referer: https://staging.hoeckner.com/wp-content/plugins/matomo/app/config/global.ini.php

    If I rename /wp-content/plugins/matomo/.htaccess to /wp-content/plugins/matomo/.htaccess.bak the error does not show again.

    At the top of the htaccess file you’ll find
    # Do not allow access to any php file directly unless it is index/matomo.php
    Well, I guess it does just that. I guess the plugin forces the client browser to attempt accessing the config file, and should just not do that.

    That would usually not cause any issue, besides the error being logged.
    But in my case, the webserver is running fail2ban, and that blocks the client IP after 6 attempts to access that config file. Not funny, my customer was locked out of his own website for at least 10 minutes several times….

    Can you fix that?

    Thanks,
    Christian Toller
    tethis IT
    Vienna, Austria

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 21 total)
  • Having the same problem. Impossible to configure the plugin because each time I click on the Matomo setting or diagnostics, I get blocked by the webserver for 30 minutes. What happenend with the lastest version of Matomo?

    AH01630: client denied by server configuration: /home/www/wordpress/wp-content/plugins/matomo/app/config/global.ini.php

    • This reply was modified 1 year, 7 months ago by wpzugang.

    Hello, still no news after 3 weeks?

    Plugin Support emermatomo

    (@emermatomo)

    Hello @chtoller and @wpzugang Sorry for the late response. Can you please backup the .htaccess of Matomo and create a new one? Then, please copy and paste this script to the new .htaccess file. Please let us know how it goes.

    # This file is provided from Matomo Analytics, do not edit directly
    # Please report any issue or improvement directly to the Matomo team.
    # Do not allow access to any php file directly unless it is index/matomo.php
    <Files ~ "(\.php)$">
    <IfModule mod_version.c>
    	<IfVersion < 2.4>
            Order allow,deny
            Deny from all
    	</IfVersion>
    	<IfVersion >= 2.4>
    		Require all denied
    	</IfVersion>
    </IfModule>
    <IfModule !mod_version.c>
    	<IfModule !mod_authz_core.c>
            Order allow,deny
            Deny from all
    	</IfModule>
    	<IfModule mod_authz_core.c>
    		Require all denied
    	</IfModule>
    </IfModule>
    </Files>
    <Files ~ "^((index|piwik|matomo)\.php)$">
    <IfModule mod_version.c>
    	<IfVersion < 2.4>
            Order allow,deny
            Allow from all
    	</IfVersion>
    	<IfVersion >= 2.4>
    		Require all granted
    	</IfVersion>
    </IfModule>
    <IfModule !mod_version.c>
    	<IfModule !mod_authz_core.c>
            Order allow,deny
            Allow from all
    	</IfModule>
    	<IfModule mod_authz_core.c>
    		Require all granted
    	</IfModule>
    </IfModule>
    </Files>
    
    # Serve HTML files as text/html mime type - Note: requires mod_mime apache module!
    <IfModule mod_mime.c>
       AddHandler text/html .html
       AddHandler text/html .htm
    </IfModule>
    Plugin Support emermatomo

    (@emermatomo)

    Hi?@chtoller and @wpzugang as it has been 2 weeks I’m assuming this has been resolved. If there’s still an issue feel free to comment and we’re happy to follow up.

    Hello @emermatomo and sorry that I haven’t replied yet on your suggestion. The issue still exists but I couldn’t find time to try your possible solution yet. I was hoping that @chtoller will try first ??

    Could you please explain how to backup the .htaccess of Matomo and create a new one? Or do you have a tutorial for that? I could find this tutorial but it does not seem to be applicable to the wordpress plugin? Or which part do I miss? https://matomo.org/faq/how-to-install/faq_138/

    • This reply was modified 1 year, 7 months ago by wpzugang.

    …and please change status back to unresolved.

    Plugin Support emermatomo

    (@emermatomo)

    @wpzugang you can rename the “.htaccess” file to “.htaccess.bak”. Then you can create a new file and name it as “.htaccess”. Then, edit this file, copy and paste the script mentioned above.

    Thread Starter chtoller

    (@chtoller)

    Hi there,

    sorry, I was travelling for three weeks and couldn’t try this.

    I just did as requested, but the new .htaccess did not change anything.
    Which is to be expected, because the old and new htaccess are identical (except for a missing newline at the end)

    root@host3:/var/www/vhosts/tethis-it.at/matomo.tethis-it.at/wp-content/plugins/matomo# diff .htaccess.bak .htaccess
    49c49
    < </IfModule>
    ---
    > </IfModule>
    \ No newline at end of file
    

    Therefore, the error stays the same. When accessing Matomo from the wordpress backend (https://matomo.tethis-it.at/wp-admin/admin.php?page=matomo-get-started) you’ll get the following in error_log:

    [Mon Apr 24 08:15:49.514243 2023] [authz_core:error] [pid 1917] [client 94.16.33.171:0] AH01630: client denied by server configuration: /var/www/vhosts/tethis-it.at/matomo.tethis-it.at/wp-content/plugins/matomo/app/config/global.ini.php
    [Mon Apr 24 08:15:49.566695 2023] [authz_core:error] [pid 1918] [client 94.16.33.171:0] AH01630: client denied by server configuration: /var/www/vhosts/tethis-it.at/matomo.tethis-it.at/wp-content/plugins/matomo/app/config/global.ini.php
    [Mon Apr 24 08:17:29.632972 2023] [authz_core:error] [pid 1917] [client 94.16.33.171:0] AH01630: client denied by server configuration: /var/www/vhosts/tethis-it.at/matomo.tethis-it.at/wp-content/plugins/matomo/app/config/global.ini.php
    [Mon Apr 24 08:17:29.676590 2023] [authz_core:error] [pid 1919] [client 94.16.33.171:0] AH01630: client denied by server configuration: /var/www/vhosts/tethis-it.at/matomo.tethis-it.at/wp-content/plugins/matomo/app/config/global.ini.php
    

    Could you please take a look again?
    If you want, I could even provide access to a matomo installation on one of my servers for you to try, but I assume you should easily be able to reproduce it.

    Thanks,
    Christian

    Plugin Support emermatomo

    (@emermatomo)

    @chtoller can you please check if it’s possible to get the users system report to see if there are any errors in there.
    Under Diagnostics ->system report

    If there is, please send it to us so we can investigate on this further.

    I could get to that page and the only error that is listed is:

    PHP Error Reporting After bootstrap: 4437

    Plugin Support emermatomo

    (@emermatomo)

    @wpzugang I found a similar case: https://forum.matomo.org/t/archiving-error-php-fatal-error-failed-opening-required-classes-wpmatomo-logger-php/49278/2

    Can you please edit your wp-config.php and adding the following line:

    define( ‘MATOMO_SUPPORT_ASYNC_ARCHIVING’, false );

    Plugin Support emermatomo

    (@emermatomo)

    Hi?@wpzugang As we didn’t receive a response, we’ll update the status of this post to resolved. If you’re still having issues, feel free to leave a comment and we’d be happy to assist.

    @emermatomo Hello, unfortunately I didn’t have time to care about my website for the last 2 months. No I checked your suggestion.

    Can you define where to add define(‘MATOMO_SUPPORT_ASYNC_ARCHIVING’, false ); ?

    If I just add it to the config.php bottom, the whole website does not work anymore.

    Edit, there was a writing mistake. I had to use ‘ instead of

    I added: define( 'MATOMO_SUPPORT_ASYNC_ARCHIVING', false );

    But still does not work. The website is still being blocked after I move to Matomo plugin. It would be really nice if there is a way to make Matomo work with wordpress.

    • This reply was modified 1 year, 4 months ago by wpzugang.
    • This reply was modified 1 year, 4 months ago by wpzugang.
    • This reply was modified 1 year, 4 months ago by wpzugang.
    Plugin Support emermatomo

    (@emermatomo)

    Hello @wpzugang You’ll have to add the following line to your?wp-config.php
    The wp-config. php file is usually located?in the root folder of your website?with other folders like /wp-content/.

    @emermatomo Yes I found the wp-config.php with filezilla, edited it with notepad and then uploaded again to the server.

    But whee is “the following line”? Which one is the correct line? Maybe I made a mistake.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘“AH01630: client denied by server configuration” while accessing backend’ is closed to new replies.