Applicable to:
- Plesk Onyx for Linux
Symptoms
-
Unable to upload a file to the website hosted in Plesk with the 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: [:error] [pid 21701] [client 203.0.112.2] ModSecurity: Request body no files data length is larger than the configured limit (1048576).. Deny with code (413) [hostname "www.example.com"] [uri "/wp-admin/admin-ajax.php"] [unique_id "Wakfj-fvNMmcLKLp-n8PjQAAAAE"]
Cause
WAF_SECREQUESTBODYNOFILESLIMIT
parameter value reached its limit.
Resolution
-
Log into the server via SSH.
-
Open
/etc/asl/config
file using the vi text editor. -
Increase the value for the
WAF_SECREQUESTBODYNOFILESLIMIT
directive, for example to the value as below:CONFIG_TEXT: WAF_SECREQUESTBODYNOFILESLIMIT "10000000"
Note: it is specified in Bytes.
-
Execute the command below to update the rulesets:
# for i in daily weekly monthly; do /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php -f UpdateModSecurityRuleSet --period "${i}"; done
This way the change will remain persistent after any updates/rulesets changes.
Comments
4 comments
Hi,
In CentOS 7 with Obsidian, the changes are working when modifying the file
/etc/httpd/conf/modsecurity.d/rules/tortix/modsec/tortix_waf.conf
The file /etc/httpd/conf.d/mod_security.conf is no existan.
Regards
Hello Alejandro Betancor
I've checked this on my test server and agree with you.
I will pass this to the article author.
how can that be done on ubuntu?
Hello Shai, article updated and new instructions can be done on Ubuntu too.
Please sign in to leave a comment.