Plesk

Unable to upload file to the website hosted in Plesk when Imunify is present on the server: Request body no files data length is larger than the configured limit

Symptoms

Cause

The error is caused by the limit of the SecRequestBodyNoFilesLimit within the Imunify360 ruleset for ModSecurity being reached, which makes ModSecurity deny the upload action.

Resolution

Proceed to increase the resource necessary ModSecurity limits as follows:

Click on a section to expand

Globally on the server

  1. Log in to the server via SSH.

  2. Create the file zz_modsec2.conf:

    • On CentOS/RHEL/CloudLinux:

      /etc/httpd/conf.d/zz_modsec2.conf

    • On Debian and Ubuntu:

      /etc/apache2/conf.d/zz_modsec2.conf

    and set the following in it with a text editor:

    <IfModule mod_security2.c>
    SecRequestBodyLimit 546870912
    SecRequestBodyNoFilesLimit 546870912
    </IfModule>

    Note:  The Limit below is specified in Bytes and equals 512 Megabytes.

  3.  Restart Apache server:
  • On CentOS/RHEL/CloudLinux:

    # systemctl restart httpd

  • On Debian and Ubuntu:

    # systemctl restart apache2

By specific domain

  1. Log in to Plesk

  2. Go to Domains > example.com > Apache & Nginx Settings and set the following in both the Additional directives for HTTP and Additional directives for HTTPS fields:

    Note: The Limit below is specified in Bytes and equals 512 Megabytes.

    <IfModule mod_security2.c>
    SecRequestBodyLimit 546870912
    SecRequestBodyNoFilesLimit 546870912
    </IfModule>