Apache 413请求实体太大而大字符串

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Apache 413请求实体太大而大字符串相关的知识,希望对你有一定的参考价值。

最近我改为专用服务器,我开始遇到问题,在jquery ajax帖子中保存大字符串。在旧的服务器工作正常,但在这个新的服务器我得到一个Apache 413错误。

Firebug发送此回复:

Encabezados de la respuesta
Connection  close
Content-Encoding    gzip
Content-Length  331
Content-Type    text/html; charset=iso-8859-1
Date    Mon, 06 Aug 2012 20:53:23 GMT
Server  Apache
Vary    Accept-Encoding
Encabezados de la petición
Accept  */*
Accept-Encoding gzip, deflate
Accept-Language es-MX,es;q=0.8,en-us;q=0.5,en;q=0.3
Connection  keep-alive
Content-Length  1105294
Content-Type    application/x-www-form-urlencoded; charset=UTF-8
Cookie  SpryMedia_DataTables_table-objetos_crear.php=%7B%22iCreate%22%3A1344285216690%2C%22iStart%22%3A0%2C%22iEnd%22%3A10%2C%22iLength%22%3A10%2C%22sFilter%22%3A%22%22%2C%22sFilterEsc%22%3Atrue%2C%22aaSorting%22%3A%5B%20%5B1%2C%22asc%22%5D%5D%2C%22aaSearchCols%22%3A%5B%20%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%5D%2C%22abVisCols%22%3A%5B%20true%2Ctrue%2Ctrue%2Ctrue%2Ctrue%5D%7D; SpryMedia_DataTables_confs-tabla_index.php=%7B%22iCreate%22%3A1344286395266%2C%22iStart%22%3A0%2C%22iEnd%22%3A8%2C%22iLength%22%3A10%2C%22sFilter%22%3A%22%22%2C%22sFilterEsc%22%3Atrue%2C%22aaSorting%22%3A%5B%20%5B8%2C%22desc%22%5D%2C%5B4%2C%22asc%22%5D%2C%5B0%2C%22asc%22%5D%2C%5B1%2C%22asc%22%5D%2C%5B2%2C%22asc%22%5D%5D%2C%22aaSearchCols%22%3A%5B%20%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%5D%2C%22abVisCols%22%3A%5B%20true%2Ctrue%2Ctrue%2Ctrue%2Ctrue%2Ctrue%2Ctrue%2Ctrue%2Cfalse%2Ctrue%2Cfalse%5D%7D; PHPSESSID=3d8f502be166becd4e504a438eb2b4ae; chkFiltroCol2=; COL=misconfs; ACCION=CONF_EDITAR_CONTENIDO; CONF_ID=279
Host    eduweb.mx
Referer http://myserver.com/edit-article.php
User-Agent  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1
X-Requested-With    XMLHttpRequest

谷歌搜索我发现错误是在LimitRequestBody的大小,我将其更改为64Mb但我仍然收到此错误。

任何想法如何解决这个问题?

答案

这对我有用:

在modsecurity.conf文件中

在我的Ubuntu 14.04上,配置文件在这里,但这实际上取决于系统:/etc/modsecurity/modsecurity.conf

将这两个命令更改为此值:

SecRequestBodyLimit 13107200

SecRequestBodyNoFilesLimit 13107200

另一答案

LimitRequestBody可能不是你想要的。这是请求主体,而不是标题,它看起来太长了。尝试将the LimitRequestFieldSize(默认为8k)设置为更大的值(请注意有关此设置优先级的警告)。

另一答案

您可能会遇到SSL重新协商缓冲区溢出情况。检查Apache日志文件。如果是这种情况,快速修复是使用SSLRenegBufferSize指令来增加重新协商缓冲区。见SSL Renegotiation with Client Certificate causes Server Buffer Overflow

以上是关于Apache 413请求实体太大而大字符串的主要内容,如果未能解决你的问题,请参考以下文章

413 请求实体太大 + Web 服务器连接已关闭 |错误 64

413 请求实体太大 IIS 10

WCF:远程服务器返回错误:(413)请求实体太大[重复]

具有 30mb 输入字符串的 WCF 服务 - 远程服务器返回错误:(413)请求实体太大

上传报告失败 - HTTP 代码 413:页面未显示,因为请求实体太大

413 请求实体太大 AWS Elastic Beanstalk