Ubuntu 14.04
Sponsored Link

Use mod_ratelimit2016/02/20

 
Enable mod_ratelimit module to limit bandwidth of clients.
[1] mod_ratelimit is included in apache2 package, so it's possible to configure quickly.
root@www:~#
a2enmod ratelimit

root@www:~#
vi /etc/apache2/conf-available/ratelimit.conf
# create new

# for example, limit bandwidth as 500 KB/sec under the /download location

<IfModule mod_ratelimit.c>
    <Location /download>
        SetOutputFilter RATE_LIMIT
        SetEnv rate-limit 500
    </Location>
</IfModule>
root@www:~#
a2enconf ratelimit

root@www:~#
/etc/init.d/apache2 restart

* Restarting web server apache2
...done.
[2] Access to the location to make sure the settings is effective.
The upper one is downloading from the limited location, the lower is downloading from a unlimited location.
Matched Content