6

My apache server sends a "Request Entity too Large" error, when I am trying to upload a file. This happens when the actual "post body" is sent by the client after about 10 seconds of sending the "request header". Is there any way to disable this on Apache.

4 Answers 4

10

There's a method using mod_security, assuming you don't mind making it much larger:

You can also limit the size of the HTTP request body data. This is very handy for disabling large data in HTTP POST requests.

SecRequestBodyLimit 10485760

This is probably worth a read about any consequences of such a change: Mod Security HOWTO

1
  • 1
    Was looking for a reason why for hours and completely forgotten about enabled mod_security and its directives! Thanks!
    – Ilia Ross
    Jan 21, 2014 at 11:16
3

If you're using PHP on the server to upload the file, you might want to look in your apache configs for something that looks like "LimitRequestBody" or other restrictions on the size of the data allowed for upload. post_max_size is another thing to look for in php.ini, along with upload_max_filesize

0

I found the answer. There is a Apache setting for this:

RequestReadTimeout

More can be found at:

http://httpd.apache.org/docs/2.2/mod/mod_reqtimeout.html

1
  • 6
    The document say that it returns 408 REQUEST TIME OUT, not 413 Request Entity Too Large.
    – petertc
    Apr 8, 2016 at 8:32
0

It's what worked for me:

in modsecurity.conf file

On my Ubuntu 14.04 the config file is here but this really depends on the system:/etc/modsecurity/modsecurity.conf

change this two commands to this values:

SecRequestBodyLimit 13107200

SecRequestBodyNoFilesLimit 13107200

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .