Limiting Bandwidth Usage By VirtualHost [HOWTO]

I have been toying with this as well but have no solution.

There has to be a way to run this server wide I just can’t figure it out.

Basically giving apache a MPS limit server wide.

What I did is put it in the base vhost config file so that when a new site is generated then it will automatically be placed in the config for it. I’m sure there is a way to get it to be global among all sites but in the meantime this is the best I could come up with. You just have to manually add it to the pre-existing sites. The nice thing is that you can go and manually adjust it later to something else or eliminate it entirely if you find that it wouldn’t be useful for that particular site.

That is good, my problem is that I wanted to limit the collective amount of the server. otherwise each site basically could use it’s limit and the server could use up too much bandwidth as a whole.

But thanks!!!

yum install apr-devel apr-util-devel

how to do when we dont have fedora core ?

actually i have ubuntu

:mad: help me please

Errr, it’s quite obvious that Ubuntu doesn’t use an RPM system by default, which is also a reason that InterWorx doesn’t support it. Ubuntu is based on Debian, which runs on apt. Use ‘man apt’ for information on how to use it. Common uses are:

apt-get update
apt-get upgrade
apt-get install packagename
apt-cache search program

cant found package

with apt-get install apr-devel apr-util-devel

I’ve been testing this and found that it shares the bandwidth limitation with connected users.

  BandwidthModule On
  ForceBandWidthModule On
  LargeFileLimit .avi 1 1310720
  LargeFileLimit .mpg 1 1310720

Is resulting in download speeds of only 20KB/s if a lot of people are trying to download the file at once.

Has anyone else found this? I couldn’t see anything in the documentation about this.

trying to install but get this each time?

[root@******* mod_bw-0.7]# /usr/sbin/apxs -i -a -c mod_bw-0.7.c
/usr/lib/apr/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -I/usr/kerberos/include -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apr-0 -I/usr/include/httpd  -c -o mod_bw-0.7.lo mod_bw-0.7.c && touch mod_bw-0.7.slo
gcc: mod_bw-0.7.c: No such file or directory
gcc: no input files
apxs:Error: Command failed with rc=65536

any idea please ?

thank you

I’m no expert but I’m pretty sure it is because you need gcc installed.

In the terminal run:

yum install gcc

… then try again.

gcc was already installed i chcked, but thank you for you reply.

started again and went ok this time, not sure what i did wrong mind.

Thank you for the tutorial