mod-bandwidth-for-apache-control-your-website-bandwidth

It is used to limit bandwidth utilization of your normal and virtual hosts.
Home Page: http://ivn.cl/files/source/mod_bw-0.8.tgz System /. OS : CentOS 5
You will need  httpd-devel should be installed.
cd ~
wget http://ivn.cl/files/source/mod_bw-0.8.tgz
tar xzf mod_bw-0.8.tgzcd mod_bw
apxs -i -a -c mod_bw.c
...
...

chmod 755 /usr/lib/httpd/modules/mod_bw.so

[activating module `bw' in /etc/httpd/conf/httpd.conf]
You should be able to see the LoadModule command in your httpd.conf . You can restart apache
at this time.
# grep bw /etc/httpd/conf/httpd.conf
LoadModule bw_module          /usr/lib/httpd/modules/mod_bw.so
service httpd restart
In Virtual Host section:-
We will restrict all downloads of files larger than 500kb, to a speed of 50kb/s. 
   
BandwidthModule On   
ForceBandWidthModule On    
# Unlimited Bandwidth for all (except for large files, see below):- 
BandWidth all 0   
# No one should be able to open more than 5 simultaneous connections at one time :-    
MaxConnection all 5   
# Limit files greater than 500kb to 50kb/s:-   
LargeFileLimit * 500 50000   
ServerAdmin webmaster@yourdomain.com This e-mail address is being protected from spambots. You need JavaScript enabled to view it
This e-mail address is being protected from spambots. You need JavaScript enabled to view it 

DocumentRoot /var/www/vhosts/yourdomain.com/httpdocs   
ServerName yourdomain.com   
ServerAlias ftp.yourdomain.com www.yourdomain.com......

Restart Apache web service.

service httpd restart 

No comments:

Post a Comment