linux poison RSS
linux poison Email

Limit file upload size on Apache

The LimitRequestBody directive allows the user to set a limit on size of the request. If the client request exceeds that limit, the server will return an error response instead of servicing the request.

The value of LimitRequestBody can be between 0 bytes (meaning unlimited) to 2147483647 (2GB).

For example,if we want to limit upload size to 100k for  /srv/www/htdocs/uploads, we need to add below commands to .htaccess or httpd.conf.
<Directory "/srv/www/htdocs/uploads">
    LimitRequestBody 102400
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.


Post a Comment

Related Posts with Thumbnails