mod_slotlimit.c
Luca Ercoli <luca.e@seeweb.it>


mod_slotlimit is an Apache module that using dynamic slot allocation
algorithm and static rules, can manage resources used for each running site.


Requirements:
  Apache 2.x


--------------------------------------------------------------------------
Synopsis
--------------------------------------------------------------------------

<IfModule mod_slotlimit.c>

AvailableSlotsPercent 13

MaxConnectionsPerSite 40

LimitSite www.BadSite.xxx
LimitSiteConnections 25

ClientIpLimit 15

ForceVhostName On

</IfModule>


--------------------------------------------------------------------------
Directives
--------------------------------------------------------------------------

AvailableSlotsPercent
    Syntax:   AvailableSlotsPercent number
    Default:  13

    Percentage of apache slots available in order to set any restrictions.
    Setting it to 0 dynamic slot allocation algorithm will be deactivated.

MaxConnectionsPerSite
    Syntax:   MaxConnectionsPerSite number
    Default:  No Limit

    Max connections for each running site

LimitSite
    Syntax:   LimitSite site's name
    Default:

    Specific site to limit (You can limit differently only one site).
    Setting this directive you must configure LimitSiteConnections or
    default value (20) will be used.

LimitSiteConnections
    Syntax:   LimitSiteConnections number
    Default:  20

    Max connections for "LimitSite"

ClientIpLimit
    Syntax:   ClientIpLimit number
    Default:  No Limit

    Number of maximum simultaneous connection per IP to the web server.

ForceVhostName
    Syntax:   ForceVhostName On|Off
    Default:  Off

    Force vhost hostname in scoreboard. Vhost hostname do not match site
    visited under some conditions, for example if you're using mod_vhost_alias.
    Setting this directive to On, mod_slotlimit will overwrite vhost hostname
    in apache scoreboard.

CustomErrMsg

    Syntax:   CustomErrMsg "My custom error message"
    Default:  "Blocked by mod_slotlimit. More information about this error may be available in the server error log."

    A custom error message that allows you to replace default error message with one you create


------------------------------------------------------------------------------
Install as DSO
------------------------------------------------------------------------------

If you have got the apxs2 (APache eXtenSion tool) tool installed, write the
following commands to build module:

$ tar xzvf mod_slotlimit.tar.gz
$ cd mod_slotlimit-1.1
$ make
$ make install


Check that in the main config file of your web server there is the following command:

LoadModule slotlimit_module  /usr/lib/apache2/modules/mod_slotlimit.so

(The path to mod_slotlimit.so depends on your apache installation)
