View Full Version : Configuring mod_limitipconn.c
jacu_80
2012-03-25, 01:33 PM
Hi,
I installed this module (dominia.org/djao/limitipconn2.html"mod_limitipconn.c which limits the maximum number of connections per IP address.
To configure this module I edited /etc/httpd/conf/httpd.conf and turned on ExtendedStatus
To configure this module all I need to do is to place the following code in httpd.conf and restart httpd service
<IfModule mod_limitipconn.c>
<Location /videos>
MaxConnPerIP 1
</Location>
</IfModule>
My problem is that I don't know where to place this code as I have many httpd.conf files. My guess was to edit
xxxxxxx.xxxxx_httpd.include located in: var/www/vhosts/vps-xxxxxx-xxxxx.manage.myhosting.com/conf/
Any suggestions?
Thanks
suwunk
2012-03-25, 09:42 PM
Hi Jacu_80
On CentOS Linux the main Apache configuration file is located in /etc/httpd/conf/.
http://myhosting.com/kb/Plesk_VPS_for_Business_-_VPS_Optimized
Cheers
jeremya
2012-03-26, 10:14 AM
It sounds like you're wanting to set it globally. If so, setting it up in /var/www/vhosts/vps-xxxxxx-xxxxx.manage.myhosting.com/conf/ probably won't work as that vhost is one single site in your configuration.
Are you running Plesk? Which version? In 10.4.4 there are apache module tools that let you turn certain modules on/off automatically. Not sure if that particular mod is in there but it's worth checking.
Lastly, are you running centos or debian?
jacu_80
2012-03-26, 01:13 PM
I am running Plesk v10.4.4 on Centos.
So your suggestion is to set the configuration inside the Apache configuration file (/etc/httpd/conf/httpd.conf)?
If yes then would I just type in the full path to my videos direcotry as follows?
<IfModule mod_limitipconn.c>
<Location /var/www/vhosts/vps-xxxxxx-xxxxx.manage.myhosting.com/mysite/videos>
MaxConnPerIP 1
</Location>
</IfModule>
jeremya
2012-03-26, 02:10 PM
Well, when you put it that way, it sounds like you actually are only concerned with on particular site. I would do two things:1) Check that module is getting successfully loaded into apache. To verify, check your Plesk Apache settings at https://your-server-ip:8443/admin/server/optimization-settings, you should be able to see your mod in that list and checked assuming its properly installed and available to Apache.
2) Then i would try it in the vhosts section as you mentioned originally, if that fails, try it in the main apache config.
That said, I am largely guessing, i would refer to the documentation on the module for best advice when using vhosts.
jacu_80
2012-03-26, 09:22 PM
Ok, here is what I found out.
Even through the module is installed and working properly, it doesn't show in the control panel.
To get the module working, I ended up doing all the configuration in the /etc/httpd/conf/httpd.conf, and I added the following code inside the same file.
The location tag has '/' so that it only allow for 15 connections per IP address on all directories except for images.
<IfModule mod_limitipconn.c>
<Location />
MaxConnPerIP 15
NoIPLimit image/*
</Location>
</IfModule>
Thanks