Addon Module: mod_bandwidth

"Mod_bandwidth" is a module for the Apache webserver that enable the setting of server-wide or per connection bandwidth limits, based on the directory, size of files and remote IP/domain.

Click to expand...

How do I enable it for a domain
In root shell type: /scripts/setbwlimit then follow the instructions (remember you are setting the limit based on bytes per second so 1024 = 1kb sec and that is to all users)

Can this be done from WHM ... perhaps a Feature Request. Long back i had been on WireX Immunix and their control panel had this feature of defining/editing the Bandwidth Limits during Account Setup/Editing Later on.

If this could be done as a Part of Account Functions, in WHM, it would be good.

I received the successful installed messages, telling me to go in to SSH to enable it on domains.

Went in to SSH, typed in the command. Was requested for the domain name, entered it, then the speed, I typed in 1024, to ensure I would notice a BIG difference.
Confirmation message saying it had been added.

Tried the domain, still as fast as before, well over 1k. I tried restarting Apache, still the same result. I also tried it on another domain, however with the same result, absolutely no reduction in speed.

I looked in HTTPD.CONF, new entries had been entered in for the domains and for the module. I have no idea what I am doing wrong, I have followed the instructions carefully.

Many of you now probably think I am mad, seemingly having a conversation with myself, since CPanel now seem to have gone quiet. However this may not have been in vain, since I have solved the problem.

chown nobody:nobody -R /var/cpanel/apachebw

All I needed to do is type the command in above, simple! A permission error!

I also needed to make a couple of amendments in httpd.conf also, to make it work. The first being the addition of “BandWidthModule On”.

Also the auto set-up script of bandwidth seems to add the wrong code. It does indeed add some code just before the </virtualhost>, however it doesn’t do anything. Anyway I am manually adding in the restrictions for the time being, only being a couple of accounts, not a huge problem.

Some of you may find this guide an interesting read too, this is what helped me solve my problem.

Many of you now probably think I am mad, seemingly having a conversation with myself, since CPanel now seem to have gone quiet. However this may not have been in vain, since I have solved the problem.

chown nobody:nobody -R /var/cpanel/apachebw

All I needed to do is type the command in above, simple! A permission error!

I also needed to make a couple of amendments in httpd.conf also, to make it work. The first being the addition of “BandWidthModule On”.

Also the auto set-up script of bandwidth seems to add the wrong code. It does indeed add some code just before the </virtualhost>, however it doesn’t do anything. Anyway I am manually adding in the restrictions for the time being, only being a couple of accounts, not a huge problem.

Some of you may find this guide an interesting read too, this is what helped me solve my problem.

CPanel, if you want an in depth guide to what went wrong, please do not hesitate to e-mail me.

Click to expand...

Thanks for the fix, it is still beta and issues can arrise
This is actually already in the install script, do you know what the permissions were before?
btw we were not ignoring you, all development staff had to work on an exploit that was released to the public before released to us.

This is actually already in the install script, do you know what the permissions were before?

Click to expand...

Tried installing it an hour ago.
- The shell script does not add 'BandWidthModule On'
- The proper directories are added, and referenced in httpd.conf, but have root ownership

Inserting the mentioned directive per virtual host and setting the ownership of the temp dir to nobody gets things running. You can also just turn it on outside a virtual host and it stays on.
- Needs a(n easy) method of setting a redirect page when max connections are reached.
- Easy to work around, from an account holder view, without further apache restrictions

LargeFileLimit is a good one to keep people from sucking all the bandwidth when people are downloading huge files.... I DID notice though the LargeFileLimit bandwidth rate seems to be only about half of what you put there. I had to compensate to get it to work right. Not sure why... pipe in if you know!

We have had exactly the same problems with the bandwidth acting strangely. Although we compensated to begin with, you will find if you start two downloads going at the same time, it will complete throw that theory right out of the window.

We added the “BandWidthPulse” command, set to 1 second, this seems to have solved the problem.