I‘d like to put limits on user(s) who are uploading files. How do I restricts the total size of the HTTP request body sent from the client under Apache 2 Web server?
Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | Yes |
Requirements | Apache 2.x |
Time | N/A |
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>
Save and close the file. You need to restart or reload the httpd server as follows:
# service httpd restart
OR
# service httpd reload
References:
🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.
🐧 4 comments so far... add one ↓
🐧 4 comments so far... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
how can I restrict abuse the internet (heavy download) on my linux firewall
The example is a bit misleading, since most probably files being uploaded to the /wp-uploads directory will be uploaded via a request to a script which is in another folder (usually its parent).
Thanks you, Greetings from Chile
It’s old, but it’s a high ranking on Google, so I’m going to correct slightly here: you don’t need to do an httpd restart. Do a reload – it saves resources and keeps everything online.