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:
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Linux / UNIX FAQ:
- Apache 403 Forbidden Error and Solution
- Howto rebuild Apache for Cpanel Linux / UNIX Server (Control Panel)
- Apache prevent hot linking or leeching of images using mod_rewrite howto
- How to: Run a shell script with nohup command
- How do I find out syntax errors in my Apache web server configuration file?
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!
Tags: .htaccess, apache .htaccess, apache 2, configuration options, Limiting Upload Size, LimitRequestBody, request body, restart apache web server, uploads, virtual host ~ Last updated on: April 26, 2008



April 28th, 2008 (3 weeks ago) at 9:28 am
how can I restrict abuse the internet (heavy download) on my linux firewall