If you wish to have some caps for the number of connections and amount of bandwidth a client can use, mod_bw is a simple modules for this.
To install it, run the following:
cd /root
wget http://files.directadmin.com/services/custombuild/mod_bw-0.92.tgz
mkdir mod_bw
cd mod_bw
tar xvzf ../mod_bw-0.92.tgz
/usr/sbin/apxs -i -a -c mod_bw.c
Now, you must turn it on and set it up in the main httpd.conf. Â Edit the file:
nano /etc/httpd/conf/httpd.conf
and after the line:LoadModule bw_module      /usr/lib/apache/mod_bw.so
add more code that looks like thisBandWidthModule On
ForceBandWidthModule On
BandWidth all 102400000
MinBandwidth all -1
MaxConnection all 3
#<Location /modbw>
#Â Â Â SetHandler modbw-handler
#</Location>
The bandwidth limit is set to 100 Meg per second
A bandwidth value must be set in order for the IP limit to work. Â Setting an unlimited value will cause the module to ignore the IP connection count, hence must be a number, hence the large number which is unlikely to be hit.
Don't forget to restart apache after making the changes, eg:
/etc/init.d/httpd restart
If you wish to monitor your connections and transfer rates, you can remove the # characters in front of the 3 Location lines, and restart apache. Â Access any IP or domain with /modbw to get details on your connections. Â (you can change /modbw to something else if you wish, or use the Allow/Deny options to make it more secure)