cPanel Request body no files data length is larger than the configured limit

On a WordPress website hosted on Cpanel server, when editing a page, i get 404 error. On checking ModSecurity logs, found the following

Message: Request body no files data length is larger than the configured limit (1048576).
Message: collection_store: Failed to access DBM file "/var/cpanel/secdatadir/serverok-session": Permission denied
Apache-Error: [file "apache2_util.c"] [line 277] [level 3] [client 51.38.246.115] ModSecurity: Request body no files data length is larger than the configured limit (1048576). [hostname "serverok.in"] [uri "/wp-admin/admin-ajax.php"] [unique_id "ZHQozKnDG2AlaeRW-JY2IAAAAA8"]
Apache-Error: [file "mod_proxy_fcgi.c"] [line 1011] [level 3] [status 70007] AH01075: Error dispatching request to : (polling)
Apache-Error: [file "apache2_util.c"] [line 277] [level 3] [client 51.38.246.115] ModSecurity: collection_store: Failed to access DBM file "/var/cpanel/secdatadir/serverok-session": Permission denied [hostname "serverok.in"] [uri "/index.php"] [unique_id "ZHQozKnDG2AlaeRW-JY2IAAAAA8"]
Apache-Handler: proxy:unix:/opt/cpanel/ea-php80/root/usr/var/run/php-fpm/7a4f759cc09e45f3b275cfba3a7c520dee7d7128.sock|fcgi://serverok.in
Stopwatch: 1685334220711796 301144175 (- - -)
Stopwatch2: 1685334220711796 301144175; combined=1973, p1=110, p2=1759, p3=0, p4=0, p5=69, sr=25, sw=35, l=0, gc=0
Producer: ModSecurity for Apache/2.9.7 (http://www.modsecurity.org/).
Server: Apache
WebApp-Info: "default" "14244c1b1b0e291067e05758571163ec" "-"
Engine-Mode: "ENABLED"

To fix the error, edit the file

vi /etc/apache2/conf.d/modsec/modsec2.user.conf

In the file, add

SecRequestBodyNoFilesLimit 1548576

Restart Apache

systemctl restart httpd

If the above did not work, you can try increasing value of SecRequestBodyNoFilesLimit. When you change the value, don’t forget to restart Apache webserver.

Back to Cpanel

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *