Errors - Client denied by server configuration?

Trying to run a Defender scan. I got an error "Your server resource usage is too close to your limit. Please try again in 15 minutes."

When I checked my cPanel there was no problem with the bandwidth, but I found these errors listed in the log (I've redacted some of the file names for security):

[Sat Mar 25 14:42:09.513760 2017] [access_compat:error] [pid 420204:tid 140713069332224] AH01797: client denied by server configuration: /-----defender-access-test.php
[Sat Mar 25 14:42:09.499611 2017] [access_compat:error] [pid 428794:tid 140713136473856] AH01797: client denied by server configuration: /-----index.php,
[Sat Mar 25 14:42:09.483128 2017] [access_compat:error] [pid 420204:tid 140713069332224] AH01797: client denied by server configuration: /-----wp-db.php,
[Sat Mar 25 14:42:09.468773 2017] [access_compat:error] [pid 705602:tid 140713086117632] AH01797: client denied by server configuration: -----sample.bak,
[Sat Mar 25 14:42:09.453379 2017] [authz_core:error] [pid 420204:tid 140713069332224] AH01630: client denied by server configuration: -----.htaccess,

What exactly do these mean? How do I correct the issue so I can run a scan with Defender? I've opened the site to support. Thank you.

  • Adam Czajczyk

    Hello Katrina,

    I hope you're well today and thank you for your question!

    The "resource limit" message is referring more to the memory and cpu usage rather than bandwith so that's why your cPanel doesn't report anything regarding this.

    I'd start with raising WP memory limit as there's up to 512M allowed for PHP but much less allowed for WP. Add this line to the "wp-config.php" file of your site please:

    define('WP_MEMORY_LIMIT', '256M');

    Make sure that this is located above the "/* That's all, stop editing */" line.

    Then there's the error log. The message you're getting there means that some of the files Defender tried to scan cannot be checked because web-server (Apache in this case) denies access to them. That might be caused by different reasons and I'd start with reverting following Defender Hardening fixes first (on "Defender -> Hardener" page):

    - "Prevent PHP execution"
    - "Prevent Information Disclosure"

    These options should not interfere with the scan normally but it's worth checking because with some additional security configured on Apache web-server level they might prevent access to files.

    That said, please implement both these changes and then clear site's cache and give scan another try. Let me know if it completes then or returns an error again.

    Kind regards,
    Adam

  • Adam Czajczyk

    Hello Katrina!

    Thank you for your replay.

    I would like you to try two more things.

    1. Please switch off WP Rocket cache entirely and see if that affects the issue
    2. Try increasing PHP "max_execution_time" value which is currently set to 30 seconds (it seems that ajax calls are timing out)

    To increase "max_exceution_time" first please check your server management panel (probably cPanel) for PHP settings as it's possible that this value can be changed there.

    If there's no such option, try adding following line at the very bottom of your site's .htaccess file

    php_value max_execution_time 300

    If that doesn't increase the value, remove the line and then create an empty file named "php.ini" in a root folder of your WordPress install, putting following line inside

    max_execution_time = 300

    You can check if the value has been increased by going to the "WPMU DEV -> Support" page in your site's backend and clicking on "System Info" button (it'll be shown in "PHP" tab).

    Once it's raised, try running scan again and let me know please.

    Kind regards,
    Adam

    • Enduring Epilepsy (Katrina)

      I deactivated WP Rocket plugin and the scan got a little further (6%) before the error, but when I tried adding the code you suggested to my .htaccess file I got a 500 error/white screen and couldn't access Wordpress dashboard or site. I've now returned the .htaccess to default state.

      What exactly is the execution time you are referring to? the heartbeat? I'm designing using WPMU Issue, is this something that is set in the theme?

      I need to have security and cache functioning. I paid for both WPMU and Rocket. How do I use both?

      Also - even though the scan isn't running, Defender is now showing there are 4 issues to address ??? But I can't fix them and have no way of knowing what they are. Frankly this is frustrating...

  • Predrag Dubajic

    Hi Katrina,

    Our developers are currently working on a next version of Defender that should work better with servers that are limiting the plugin CPU and Memory usage.

    We would like to have a closer look at your site and check if that's indeed the issue if you could provide us with FTP or cPanel access to your site.

    You can send us your details using our contact form https://premium.wpmudev.org/contact/#i-have-a-different-question and the template below:

    Subject: "Attn: Predrag Dubajic"
    - Site login url
    - WordPress admin username
    - WordPress admin password
    - FTP credentials (host/username/password)
    - cPanel credentials (host/username/password)
    - Link back to this thread for reference
    - Any other relevant urls

    Best regards,
    Predrag