LimitRequestBody: Apache Limiting User Upload File Size

Q. I'd like to put limits on user file uploading size. How do I restricts the total size of the HTTP request body sent from the client under Apache 2 Web server?

A. To restricts the total size of the HTTP request body sent from the client use LimitRequestBody Directive. You can add this directive using .htaccess file or httpd.conf file under virtual host or directory configuration options. You can set value (in bytes) from 0 (unlimited) to 2147483647 (2GB) that are allowed in a request body.

For example, limit /var/www/vhost/cyberciti.biz/wp-uploads to 100K, you might use the following directive (add to .htaccess or httpd.conf file):

<Directory "/var/www/vhost/cyberciti.biz/wp-uploads">
    LimitRequestBody 102400
</Directory>

Restart httpd (if added to httpd.conf):
# service httpd restart

References:

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 1 comment… read it below or add one }

1 Firas Alfraih 04.28.08 at 9:28 am

how can I restrict abuse the internet (heavy download) on my linux firewall

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Tagged as: , , , , , , , , ,

Previous post: Linux Install and Configure Netgear WG311 Marvell 88w8335 Rev 03 Chipset Wireless Card

Next post: How To Extract a Single File / Directory from Tarball Archive