Apache 413 Request Entity Too Large

On a CentOS server, when uploading a 100 MB video file in WordPress media manager, I got the following error message

Request Entity Too Large
The requested resource /wp-admin/async-upload.php
does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.

The server had mod_security installed. I edited the mod_security config file

vi /etc/httpd/conf.d/mod_security.conf

Set following for values and restart Apache.

Advertisement

SecRequestBodyLimit 1073741824000
SecRequestBodyNoFilesLimit 1073741824000
SecRequestBodyInMemoryLimit 1073741824000

But I still get the same error. So I disabled mod_security by moving the config file to a temporary directory and restarting apache.

The error was due to Apache setting LimitRequestBody, the error is fixed by adding “LimitRequestBody 0” in the .htaccess file used by WordPress.

LimitRequestBody 0

Now when I enable mod_security, I get 500 error, I disabled mod_seurity for the file upload PHP script used by WordPress by editing the Apache VirtualHost entry of the website and adding

    SecRuleEngine Off
Add a comment

Leave a Reply

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

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement