RobotLimit
Specify the maximum number of pages a user can visit without a short pause.
Also sets a limit on the number of unique sessions that can be created
for a single IP address without a short pause.
Synopsis
The parameter is expected to be a positive integer.
The default is zero (no limit).
Scope
This directive is only available for use in the local
(catalog.cfg) configuration file.
It will not affect any other website in any way.
This directive will not work in the global
(interchange.cfg) configuration file.
Description
This directive defines the number of consecutive pages a user session may
access without a 30 second pause.
If the limit is exceeded, the command defined in the
LockoutCommand global directive will be executed,
and further website URIs will be generated using "http://127.0.0.1/
as the VendURL,
sending the bad robot back to itself.
The 30 second pause,
mentioned above,
can be configured using the Limit directive's
"lockout_reset_seconds" setting.
If a remote client gets assigned a new session with every visit,
rather than maintaining a single session, then this directive sets the
limit for the number of sessions that may be assigned to the individual
IP address over a one hour period.
The one hour period can be overridden using the Limit
directive's "ip_session_expire" setting (value specified in minutes).
If a lockout is triggered it will remain in effect for 24 hours.
The 24 hour period can be overridden with the Limit
directive's "robot_expire" setting,
as shown below.
|
Availability
In Interchange versions prior to 5.5.0,
this directive controlled the number of sessions allowed for a single
IP address without a 1 day pause.
The 1 day pause could be overridden with the
Limit directive's "robot_expire" setting.
The behaviour described on this page is correct for Interchange versions
5.5.0 and later.
|
|
Compatibility Note
When upgrading from an Interchange version prior to 5.5.0,
you should delete all of the session per IP counter files
in the "tmp/addr_ctr" directory,
under your website's home directory
(assuming ScratchDir is set to "tmp").
The website's home directory is specified using the
Catalog global configuration directive.
See the "UPGRADE" file for more details.
|
If a "lockout" SpecialSub is defined
then that subroutine will be called to determine whether the lockout
should be overridden for this user.
If the "lockout" SpecialSub returns
a true value then the current user will not be locked out
of your website.
Examples
Setting the "bad robot" limit
Reducing the required pause time
|
Limit lockout_reset_seconds 20
|
Overriding the default 24-hour lockout time
The above will reduce the lockout time from 24 hours to just
under one hour.
Adding a hook to determine whether a lockout should occur at all
GlobalSub lockout_check <<EOS
sub {
return $::Scratch->{override_lockout};
}
EOS
SpecialSub lockout lockout_check
|
The above code will return the value of the "override_lockout" scratchpad variable.
If the value is true (defined value that is not zero and not blank)
then the user will not be locked out for exceeding the RobotLimit.
See also