About

Modern browsers use multiple connections in order to download content from a website such that limiting the connections to a website is usually not the preferred way to throttle traffic. Nevertheless, Apache is a comprehensive web-server that does not only serve pages, but can also offer web-services such as WebDAV, SVN, etc… In such cases, it might be preferable to restrict the number of connections per IP address.

Installing Packages

We are going to use the mod_limitipconn2 Apache module. On some distributions the module is available but on some others (such as Debian), the module will have to be compiled. In order to do that, we will need to install the apache2-dev package:

aptitude install apache2-dev

After that, retrieve the source:

wget -c http://dominia.org/djao/limit/mod_limitipconn-0.24.tar.bz2

and decompress it:

tar -jcvf mod_limitipconn-0.24.tar.bz2

Change directory to the decompressed directory and run:

make

followed by:

make install

to install the module.

Enabling the Module

After installation, the module can be enabled on Debian by issuing:

a2enmod limitipconn

or, by adding the line:

LoadModule limitipconn_module lib/apache/mod_limitipconn.so

to the Apache configuration.

Limiting Connections to a Location

Suppose that you have a virtual host serving SVN files. To limit the access to the directory, locate the stanza Location in your virtual host file, for example:

<Location /svn>
    DAV svn
    SVNParentPath /opt/svn
</Location>

and change the contents of the Location body to something like:

<Location /svn>
    DAV svn
    SVNParentPath /opt/svn
    <IfModule mod_limitipconn.c>
        MaxConnPerIP 5
    </IfModule>
</Location>

which will limit the connections to that location to 5 concurrent accesses per IP address.

For more settings, you can consult the README file distributed with the limitipconn2 module.


apache/limit_connections_per_ip_address.txt · Last modified: 2022/04/19 08:28 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.