Apache2 bandwidth limit

  • Hello here i have a Howto for limit the apache2 speed.


    The first i have tested under Debian Squeeze and i-MSCP Git MasterBuild: 20130107 Codename: Eagle


    Code
    1. apt-get install libapache2-mod-bw


    Code
    1. /etc/init.d/apache2 restart


    and than go to

    Code
    1. /etc/apache2/sites-available/customer.whatever.com.conf


    open that and copid this
    Limit every user to a max of 50Kb/s on a vhost :

    Code
    1. BandwidthModule On ForceBandWidthModule On Bandwidth all 51200 MinBandwidth all -1


    between

    Code
    1. ServerAdmin [email protected] customer.whatever.com


    so it looks like

    Code
    1. ServerAdmin [email protected] BandwidthModule On ForceBandWidthModule On Bandwidth all 51200 MinBandwidth all -1 ServerName customer.whatever.com


    save the file and restart your apache2


    so that is always with you
    got to

    Code
    1. /etc/imscp/apache/parts/domain.tpl


    put this

    Code
    1. ServerAdmin webmaster@{DMN_NAME} BandwidthModule On ForceBandWidthModule On Bandwidth all 10240 MinBandwidth all -1 ServerName {DMN_NAME} ServerAlias www.{DMN_NAME} {DMN_NAME} {ALIAS}.{BASE_SERVER_VHOST}


    Code
    1. Limit every user to a max of 50Kb/s on a vhost :BandwidthModule On ForceBandWidthModule On Bandwidth all 10240 MinBandwidth all -1


    here a Example for code


    Quelle: http://forum.directadmin.com/showthread.php?t=14782



    soory for my bad english but I still hope that everyone knows what is meant


    MFG
    Junk-Host

    Edited once, last by Junk-Host ().

  • this is very nice. having this as a configurable option in the custom section of the Vhost file for domains in i-MSCP would be a very awesome feature. hmm...