ispCP - Board - Support
[partial-HowTo] mod_cband - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Contributions Area (/forum-40.html)
+--- Forum: Howtos (/forum-41.html)
+--- Thread: [partial-HowTo] mod_cband (/thread-1499.html)

Pages: 1 2


[partial-HowTo] mod_cband - achioo - 10-11-2007 11:11 AM

First off this how to is incomplete, is currently only setup for Debian, and is made for apache2.*.

  1. su root or sudo (recommended) apt-get install apache2-prefork-dev
  2. cd /tmp
  3. wget http://cband.linux.pl/download/mod-cband-0.9.7.4.tgz
  4. tar -zxf mod-cband-0.9.7.4.tgz
  5. ./configure
  6. make
  7. make install
  8. user your favorite text editor to open /etc/apache2/httpd.com to make sure that the following line is there...
    LoadModule cband_module /usr/lib/apache2/modules/mod_cband.so
  9. now restart or reload apache
  10. now you just need to edit your /etc/apache2/sites-available/ispcp.conf and update the virtual hosts directives with their limits.
  11. when finished editing the virtual hosts just restart or reload apache and you're good to go.


The following is an example
Code:
# specify default 'bandwidth exceeded' location
CBandDefaultExceededURL    http://haha.org/bandwidth_exceeded.html

<VirtualHost *:80>
    DocumentRoot /var/www/xyz.org/
    ServerName xyz.org
    CustomLog /var/log/apache2/xyz.org.access combined
    ErrorLog /var/log/apache2/xyz.org.access.error
    RewriteEngine On
    RewriteOptions inherit

    # 100MB virtualhost bandwidth limit
    CBandLimit 100000

    # redirect to http://abc.org/bandwidth_exceeded.html
    # when the limit has been reached
    CBandExceededURL http://abc.org/bandwidth_exceeded.html

    # virtualhost's scoreboard file
    CBandScoreboard /var/run/apache2/xyz.org.scoreboard
    
    # a period of time after which the scoreboard will be cleared (30 days)
    # (only in >=0.9.5-rc2)
    CBandPeriod 30D
</VirtualHost>

References for this howto are from http://cband.linux.pl/documentation and http://easytouch.com/mod-cband-debian-install-apache-speedlimit.

If anyone has an easy way to implement this for new accounts/current accounts and would like it to be added please let me know and I'll update this HowTo. That's about the only thing that's missing.


RE: [partial-HowTo] mod_cband - gOOvER - 10-11-2007 01:51 PM

cband is a part of ispcp with an actual trunk. I don't know since when, but it's implemented and it works.


RE: [partial-HowTo] mod_cband - Breaki - 10-11-2007 08:31 PM

gOOvER Wrote:cband is a part of ispcp with an actual trunk. I don't know since when, but it's implemented and it works.

you are right, its implemented and works Wink

greetz


RE: [partial-HowTo] mod_cband - BeNe - 10-12-2007 01:23 AM

Yes, and here is the Wiki Page about it -> http://www.isp-control.net/ispcp/wiki/howto_mod_cband Wink

Greez BeNe


RE: [partial-HowTo] mod_cband - raphael - 10-12-2007 02:22 PM

All I would say is that people should usually disable or move to a protected directory the aliases set by Debian's mods-available/cband.conf which display a great amount of info about the hosts


RE: [partial-HowTo] mod_cband - achioo - 10-18-2007 01:51 AM

With the current trunk do we need to manually update users to add cband or is this automatically done?


RE: [partial-HowTo] mod_cband - BeNe - 10-18-2007 04:16 AM

I mean this is per default at 1024.
Check you Apache Config about it. There you should find it.

Greez BeNe


RE: [partial-HowTo] mod_cband - achioo - 10-19-2007 10:47 PM

BeNe I know that it's default with the SVN trunk. What I'm asking is with our existing clients do we need to go into the ispcp.conf file and add their cband limits or is this automatically done for existing clients.


RE: [partial-HowTo] mod_cband - raphael - 10-20-2007 05:37 AM

what exactly do you mean?
If you have mod_cband installed and enabled the limits you set in ispCP will be used.
As simple as that


RE: [partial-HowTo] mod_cband - psygarden - 01-28-2008 09:46 PM

How can i set the bandwidth throttle in the ispcp config panel?

i know i can limit the amount of bandwidth used by site, but i haven't seen any setting for the throttle (say i want a site to max out at 500kb/sec, and individual transfers at 100kb/sec)

greetings,
Rik