Skip to main content

Bandwidth restriction – How to limit the download speed for your visitors a terrible thing when you haven’t a very high speed upload rate on your personal server at home or VPS or even cheap dedicated server, and that 1 or few users are saturating your bandwidth (By genuinely “consuming” your content such as photos, videos, or file to share, … or even by some script kiddies downloading in loop one of your picture from your blog or so).


The best thing is obviously….to have a good upload 🙂 but as you may not be able to decide that, the next good idea is to set a bandwidth speed limit.


The Mod_bw module of Apache can help you to set restriction per Virtualhost (Different websites or services), per IP, per type of file and even per file’s size.



To install the mod_bw module, just type:

and enable it if not done automatically at the end of the installation



You can directly write your configuration inside the vhost of your choice.

If for example you want to set a limit per visitors, type of file, and size of file for your website “myblog” but without restriction on any request from your local network, edit the related virtualhost:

and add the following at the end, before the </Virtualhost>:

Obvisouly you can set as you wish. Me I used to filter only 2 levels, Bandwidth All and LargeFileLimit *

Save your file (CTRL+X, then Yes) and restart apache

Leave a Reply

Your email address will not be published. Required fields are marked *