博客园  :: 首页  :: 联系 :: 订阅 订阅  :: 管理

413 Request Entity Too Large 异常记录

Posted on 2013-05-17 07:32  Bruce Zhang  阅读(7818)  评论(0编辑  收藏  举报
在进行svn update时,总是出现如下异常:
svn: Server sent unexpected return value (413 Request Entity Too Large) in response to REPORT request for '/svn/!svn/vcc/default'

“413 Request Entity Too Large”是由web server发出来的,表示HTTP请求中的内容太大,撑爆掉了。
我的Web Server是“Apache Http”,所以需要在httpd.conf中加入如下配置:
LimitXMLRequestBody 0
LimitRequestBody 0

 

参照:http://httpd.apache.org/docs/2.2/mod/core.html#limitxmlrequestbody

LimitXMLRequestBody Directive

Description: Limits the size of an XML-based request body
Syntax: LimitXMLRequestBody bytes
Default: LimitXMLRequestBody 1000000
Context: server config, virtual host, directory, .htaccess
Override: All
Status: Core
Module: core

Limit (in bytes) on maximum size of an XML-based request body. A value of 0 will disable any checking.

Example:

LimitXMLRequestBody 0

LimitRequestBody Directive

Description: Restricts the total size of the HTTP request body sent from the client
Syntax: LimitRequestBody bytes
Default: LimitRequestBody 0
Context: server config, virtual host, directory, .htaccess
Override: All
Status: Core
Module: core

This directive specifies the number of bytes from 0 (meaning unlimited) to 2147483647 (2GB) that are allowed in a request body.

The LimitRequestBody directive allows the user to set a limit on the allowed size of an HTTP request message body within the context in which the directive is given (server, per-directory, per-file or per-location). If the client request exceeds that limit, the server will return an error response instead of servicing the request. The size of a normal request message body will vary greatly depending on the nature of the resource and the methods allowed on that resource. CGI scripts typically use the message body for retrieving form information. Implementations of the PUT method will require a value at least as large as any representation that the server wishes to accept for that resource.

This directive gives the server administrator greater control over abnormal client request behavior, which may be useful for avoiding some forms of denial-of-service attacks.

If, for example, you are permitting file upload to a particular location, and wish to limit the size of the uploaded file to 100K, you might use the following directive:

LimitRequestBody 102400

Note: not applicable to proxy requests.