PDA

View Full Version : Banwidth limiting


UsagiChan
22nd January 2009, 03:22 AM
I have a fedora 9 server. It is used purely as a dedicated server. Until recently I never came close to my allowed bandwidth of 1 TB but I expect that may change in the near future because I will be adding many files for downloading. I have Apache 2.2.9, PHP 5.2.6, mySQL 5.0.51 and Webmin 1.441.

The most critical thing is monitoring total bandwidth and then doing a job, probably using Cron to change a folder's name, to stop downloads before a critical point is reached and my sites shut down. I would also probably eventually like to limit member downloads so all members of the sites get a chance to download and one person doesn't use all the bandwidth. I expect that would be possible using php. to log the bandwidth used by members. I know php but I don't know how to get the bandwidth using php.

Any help? Ideas?

Thanks in advance.
UsagiChan

neogranas
23rd January 2009, 03:12 PM
Look into something called Quota, I think that may be a good lead for you. HowToForge has a 'Perfect Server' tutorial that explains how to set it up:

http://howtoforge.com/perfect-server-fedora9-p4

Or if you are using ProFTPd to allow for downloads, you can use Quota in conjunction with it:
http://howtoforge.com/virtual-hosting-with-proftpd-and-mysql-fedora9

I believe there is also a webmin plugin or configuration for Quota. Hope it helps, I've never tried it myself but that's because I've never had the need for it. Let us know if it works for you.