Installation of apache module mod_limitipconn on cPanel server (apache version 2.X)
mod_limitipconn is used for limiting number of connections from each ip to particular site by enabling it in virtualhost of particular site. Suppose site name is mysitename.com and it’s cPanel username mysite.
Installation :: installing module mod_limitipconn
Download mod_limitipconn & untar the file. After downloading compile mod_limitipconn with apache using following command.
/usr/local/apache/bin/apxs -cia mod_limitipconn.c
Once you finish with installation of module mod_limitipconn
Uncomment following line in virtual host of site mysitename.com in /etc/httpd/conf/httpd.conf
Include "/usr/local/apache/conf/userdata/std/1/mysite/mysitename.com/*.conf"
Now fire following command to create directory mysitename.com with it’s parent directory mysite.
mkdir -p /usr/local/apache/conf/userdata/std/1/mysite/mysite.com
cd /usr/local/apache/conf/userdata/std/1/mysite/mysite.com
Then, touch a file called ipconn.conf and in it add following line. So that site will have max 3 connections from each ip.
<Location />
MaxConnPerIP 3
# exempting images from the connection limit is often a good
# idea if your web page has lots of inline images, since these
# pages often generate a flurry of concurrent image requests
NoIPLimit image/*
</Location>
Now restart apache service.
We can directly add above lines in virtualhost of domain mysitenaem.com. But when easyapache will be done in the server, the above changes will be overwritten. To avoid this we recommend above this method.
Now run following cPanel script and restart apache service.
/scripts/ensure_vhost_includes –user=mysite













