Applicable to:
- Plesk for Linux
Symptoms
-
Unable to upload a file to a website hosted in Plesk with the following error:
CONFIG_TEXT: 413 Request entity too large
CONFIG_TEXT: Request Entity Too Large
The requested resource
/upload-a-file/
does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit. -
ModSecurity component is installed on the server.
-
The following error can be found in
/var/www/vhosts/example.com/logs/error_log
file:CONFIG_TEXT: ModSecurity: Request body no files data length is larger than the configured limit (1048576).. Deny with code (413) [hostname "example.com"] [uri "/Backoffice/index.php"] [unique_id "YCK6aBTMZUZFIMPlEoLhpAAAABk"]
Cause
The SecRequestBodyNoFilesLimit
parameter value reached its limit.
Resolution
Proceed to increase the resource limits as follows:
Click on a section to expand
-
Log in to the server via SSH.
-
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:
CONFIG_TEXT: <IfModule mod_security2.c>
SecRequestBodyLimit 546870912
SecRequestBodyNoFilesLimit 10485760
</IfModule>Note: Limits is specified in Bytes.
-
- Restart Apache server:
-
On CentOS/RHEL/CloudLinux:
# systemctl restart httpd
-
On Debian and Ubuntu:
# systemctl restart apache2
-
Log in to Plesk
-
Go to Domains > example.com > Apache & Nginx Settings and set the following as Additional directives for Apache:
PLESK_INFO: <IfModule mod_security2.c>
SecRequestBodyLimit 546870912
SecRequestBodyNoFilesLimit 10485760
</IfModule>
Comments
0 comments
Please sign in to leave a comment.