• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Plesk Obsidian Version 18.0.56 Update #4 on Ubuntu 22.04.3 LTS ModSecurity upload error on WordPress

copec

New Pleskian
Server operating system version
Ubuntu 22.04.3 LTS
Plesk version and microupdate number
Plesk Obsidian Version 18.0.56 Update #4
I'm getting an error:
Code:
ModSecurity: Request body (Content-Length) is larger than the configured limit (134217728)
when a customer tries to upload a file larger than that respective limit in the WordPress control panel.

This customer wants to upload short videos in their WordPress instance, and needs a 1GB limit, so that's the limit I've targeted in setting nginx client_max_body_size, apache2 FcgidMaxRequestLen under /opt/psa/admin/conf/templates/default/ as well as LimitRequestBody and SecResponseBodyLimit; I've also set the limits in PHP. I've regenerated all the configs and even recursively grep'd the entire server for 134217728, but I don't know where it is coming from.

I have applied the following and had a second set of eyes check it out for me too:

Anybody know where this limit is coming from?
 
Okay, I knew posting a question would make me look at something and figure it out!

You want to set SecRequestBodyLimit for uploads, not SecResponseBodyLimit

I'll put this here for posterity:
Apache config:
LimitRequestBody 1073741824
<IfModule mod_security2.c>
    SecResponseBodyLimit 1073741824
    SecRequestBodyLimit 1073741824
</IfModule>
 

Attachments

  • Screenshot 2023-12-07 at 3.04.48 PM.png
    Screenshot 2023-12-07 at 3.04.48 PM.png
    146.9 KB · Views: 3
Back
Top