Skip to content

kmcfate/mod_slotlimit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mod_slotlimit.c
Kal McFate <[email protected]>

This version is cleaned up, has a different detection method, and no longer supports
the override file for sake of performance and simplicity.

Based on work from:
Luca Ercoli <[email protected]>


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

ClientIpLimit 30

ForceVhostName On

CustomErrMsg "My custom error message"

</IfModule>


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

AvailableSlotsPercent
    Syntax:   AvailableSlotsPercent number
    Default:  0

    Percentage of apache slots available in order to set any restrictions.
    Setting it to 0 dynamic slot allocation algorithm will be deactivated.
    When has remained free the specified percentage of apache slots, module
    start to manage incoming connections, penalizing sites that are monopolizing
    the resources of the server. 
    
    N.B. Before activating this option check that the apache scoreboard display
         correct vhost name of the running sites. In order to make this you can 
         activate (momentarily) mod_status and connect to http://yourserver/server-status.
         If Vhost hostname do not display correctly the name of the sites visited
         sets up to "On" the directive "ForceVhostName" before using "AvailableSlotsPercent".

MaxConnectionsPerSite
    Syntax:   MaxConnectionsPerSite number
    Default:  No Limit

    Max connections for each running site

    N.B. Like for "AvailableSlotsPercent" if Vhost hostname do not display correctly
         the name of the sites visited sets up to "On" the directive "ForceVhostName".

ClientIpLimit
    Syntax:   ClientIpLimit number
    Default:  40

    Number of maximum simultaneous connection per IP.

ForceVhostName
    Syntax:   ForceVhostName On|Off
    Default:  Off

    Force vhost hostname in scoreboard. Vhost hostname do not match site
    visited under some conditions, for example with some mass virtual hosting technique.
    In order to check that this is not your case you can use mod_status.
    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
$ 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)

Releases

No releases published

Packages

No packages published

Languages