6

I'm trying to edit large (200KB or so) articles on my MediaWiki install, but doing so gives me this error:

Request Entity Too Large

The requested resource

/path/to/my/wiki/index.php

does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.

According to the Apache docs, the LimitRequestBody is by default 0 (unlimited). I don't think I'm near the MediaWiki limit of 2048KB. I can't find where/if PHP is limiting me.

What gives?

Update: My Apache error logs say:

request body exceeds maximum size for SSL buffer

And right below that:

could not buffer message body to allow SSL renegotiation to proceed

It appears that a possible solution can be found here.

But it requires me to recompile mod_ssl. It appears towards the end of that bug report they were talking about adding in a directive for this, instead of recompiling. Anyone know if this happened? Also, do I just need to recompile mod_ssl for this fix? And if so, how do I use my compiled version instead of the stock Ubuntu one?

3 Answers 3

6

Why don't you double check the size of the POST request. For example, you can use netcat to listen on 8080.

netcat -l -p 8080

Then, redirect your browser to use a proxy on port 8080 just before submitting the form. You should get something like this:

POST http://example.com/path/to/my/wiki/index.php HTTP/1.1
Host: example.com
Proxy-Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 217

The most important line is Content-Length and just double check the actual length of the content. That will at least help you to determine where things are going wrong. You will at least have an idea of the actual content size.

Then, ensure that you are directly connecting to Apache and not through either a proxy or a reverse-proxy. Some reverse-proxies place a cap on the maximum size of a request as a sort of security measure. So, you may want to check that as well as your Apache logs to ensure that nothing else is going on.

5
  • Yes sir, the Content-Length is ~195,000.
    – mrduclaw
    Oct 30, 2009 at 0:51
  • That was fast! Anyway, I've added the bit on the reverse proxy.
    – sybreon
    Oct 30, 2009 at 0:52
  • Good call on the logs, I'll update the question with the latest error.
    – mrduclaw
    Oct 30, 2009 at 1:01
  • 2
    Have you tried this blog.bombcar.com/2008/01/apache-413-error-problems.html
    – sybreon
    Oct 30, 2009 at 1:10
  • You, my friend, are a genius! That solves it! I wish I could up-vote you a dozen times! Thanks!
    – mrduclaw
    Oct 30, 2009 at 1:14
1

I had this same error and it was from mod security related to ajax uploading 500MB and less files, to fix I opened the config.

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

Changed this

SecRequestBodyLimit 131072 
SecRequestBodyNoFilesLimit 
SecRequestBodyInMemoryLimit

To:

SecRequestBodyLimit 524288000
SecRequestBodyNoFilesLimit 524288000
SecRequestBodyInMemoryLimit 524288000
0

I had the error "413 Request Entity Too Large".

https://stackoverflow.com/a/19447688/784542 has solved my problem.

You must log in to answer this question.

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