This module replaces the tlink and vlink programs that come with Interchange. It has been tested with all Interchange versions up to and including 5.3.1 (development). Although this module is known to have worked with MiniVend versions 3 and 4, its current compatibility has not been tested.
This module has been tested with Apache versions 1.3.6 through 1.3.33. Note that this module is not compatible with Apache 2.
InterchangeServer address
Specifies the way Apache should connect to the primary Interchange server.
InterchangeServerBackup address
Specifies the way Apache should connect to the backup Interchange server in the event that the primary server is unavailable for any reason.
InterchangeServerBackup takes the same arguments as the InterchangeServer directive but should obviously point to a different Interchange server than the primary. The InterchangeServerBackup directive is only of any use if you have multiple Interchange servers configured in a clustered environment.
ConnectTries number
Number of connection attempts to make before giving up. The default is 10.
ConnectRetryDelay seconds
Delay, in seconds, between each retry attempt. The default is 2.
DropRequestList entry entry entry
Space-separated list of URI path components to deny access to. Various attacks are made on Microsoft IIS systems and, while they don't affect Apache, they do tend to waste valuable processor time.
If any of the entries in the list are found anywhere in the requested URI, the request will be dropped with a 404 (not found) error.
A maximum of 10 entries may be present in the list.
Any other entries will be ignored.
If you need more than 10 entries, edit the IC_MAX_DROPLIST
value in mod_interchange.c
and recompile the module.
See the example below for a common use of this directive.
OrdinaryFileList entry entry entry
Space-separated list of URI path components. If one of the list entries is found at the start of any request then that request will not be passed to Interchange. Instead, the file will be directly served by Apache.
A maximum of 10 entries may be present in the list.
Any other entries will be ignored.
If you need more than 10 entries, edit the IC_MAX_ORDINARYLIST
value in mod_interchange.c
and recompile the module.
See the example below for a common use of this directive.
InterchangeScript name
The InterchangeScript parameter allows the SCRIPT_NAME to be
different from the <Location>
.
Note: The Apache
<Location /shop.name>
is invalid, whereas:
<Location /shop-name>
is valid.
Here is an example UNIX-socket configuration:
<Location /shop>
SetHandler interchange-handler
InterchangeServer /opt/interchange/etc/socket
</Location>
Here is an INET-socket example:
<Location /shop>
SetHandler interchange-handler
InterchangeServer localhost:7786
</Location>
UNIX-socket local primary connection and INET-socket remote backup connection:
<Location /shop>
SetHandler interchange-handler
InterchangeServer /opt/interchange/etc/socket
InterchangeServerBackup another.server.com:7786
</Location>
Two parameters control what happens when mod_interchange fails to connect to the Interchange server. The most likely reason for a failure to connect is that Interchange is being restarted by the administrator.
ConnectTries specifies the number of connection attempts to make before giving up. The default is 10. ConnectRetryDelay specifies the delay, in seconds, between each retry attempt. The default is 2. Connection retry example:
<Location /shop>
SetHandler interchange-handler
InterchangeServer localhost:7786
ConnectTries 10
ConnectRetryDelay 1
</Location>
If an InterchangeServerBackup directive has been specified then the backup server will be tried immediately after an attempt to contact the primary server fails. The ConnectTries and ConnectRetryDelay paramaters will only come into affect if both the primary and backup Interchange servers are found to be unavailable.
The DropRequestList allows a list of up to 10 space-separated URI components to be specified. If any of the list entries is found anywhere in the requested URI, the request will be dropped with a 404 (not found) error, without the request being passed to Interchange. This parameter is useful for blocking known Microsoft IIS attacks, such as "Code Red", so that we don't waste any more time processing these bogus requests than we have to. DropRequestList example:
<Location /shop>
SetHandler interchange-handler
InterchangeServer /opt/interchange/etc/socket
DropRequestList /default.ida /x.ida /cmd.exe /root.exe
</Location>
The OrdinaryFileList allows a list of up to 10 space-separated URI path components to be specified. If one of the list entries is found at the start of any request then that request will not be passed to Interchange. Instead, the file will be directly served by Apache. OrdinaryFileList example:
<Location />
SetHandler interchange-handler
InterchangeServer /opt/interchange/etc/socket
OrdinaryFileList /foundation/ /interchange-5/ /robots.txt
</Location>
This will result in the following:
www.example.com/index.html
(Processed by Interchange) www.example.com/ord/basket.html
(Processed by Interchange) www.example.com/foundation/images/somefile.gif
(Served by Apache) www.example.com/robots.txt
(Served by Apache)You should add a trailing slash to directory names to prevent, for instance, "/images/foo.gif" from being confused with the likes of "/images.html". If OrdinaryFileList was set to "/images" then both of those requests would be handled by Apache. If OrdinaryFileList was set to "/images/" then "/images/foo.gif" would be handled by Apache and "/images.html" would be handled by Interchange.
If you're using "<Location />
"
then you will need a dummy "index.html" file in your
VirtualHost
's DocumentRoot
directory to avoid permission problems assocated with the Apache
directory index creation code.
The InterchangeScript parameter allows the
SCRIPT_NAME
to be different from the
<Location>.
InterchangeScript example:
<Location /shop>
SetHandler interchange-handler
InterchangeServer /opt/interchange/etc/socket
InterchangeScript /foo
</Location>
The above will set the SCRIPT_NAME
to
"/foo", instead of to "/shop",
before passing the request to Interchange.
The appropriate SCRIPT_NAME
must be configured into the
Catalog
directive in your interchange.cfg
file.
ap_scan_script_header_err_buff()
Apache API function was not being examined closely
enough.
This apparently caused problems with GoogleBot and
caching proxies that make use of the
If-Modified-Since:
HTTP header.
[history-scan]
regex matches.
The entire Location
path was being
stripped from the URI, which was fine unless
<Location />
was specified.
OrdinaryFileList
code was using the
IC_MAX_DROPLIST
configurable setting instead
of its own IC_MAX_ORDINARYLIST
.
That'll teach me not to copy/paste when creating new
code. :-)
OrdinaryFileList
and
InterchangeScript
configuration parameters.
[history-scan]
tag was used.
As almost no page history was saved,
[history-scan]
sent the user to the default
page (usually index) most of the time.
This bug seems to have originated in version 1.28.
URILevels
mechanism and removed the URILevels
configuration directive.
This also fixes a bug, reported by Philip Hempel in the
interchange-users mail list, where [PT]
redirects were not being handled correctly.
URILevels
directive was not taken into
account when munging the PATH_INFO
HTTP
environment variable.
REQUEST_URI
, which caused Interchange searches
(scan) with encoded spaces to fail.
AF_LOCAL
,
PF_LOCAL
or SUN_LEN
macros.
John's patch conditionally #define
s the
missing _LOCAL
macros as aliases for
AF_UNIX
and PF_UNIX
, and
conditionally #define
s a SUN_LEN
macro.
InterchangeServerBackup
module
parameter to allow the module to automatically try a
backup Interchange server if the primary is unavailable.
DropRequestList
module parameter
to stop Interchange from having to waste its time
processing known IIS exploits.
socklen_t
.
The poor Apple URILevels
parameter to allow for
sites that need to specify <Location>
s
that have more than one directory level.
The default URILevel
is 1.
ic_send_request()
and
ic_transfer_response()
functions because
they were giving all sorts of EPIPE
errors
when writing data to clients during a concurrent-user
test.
Testing tools used were ab (ApacheBench/1.3) and httperf.
We have now lost the "connreset" errors that
were reported by httperf as well as the associated
"broken pipe" meessages in the Apache error logs.
The module now stands up properly when placed under a heavy
load.
mod_minivend
to mod_interchange
.
(Changed "mv_
" function names to
"ic_
" etc.)
<VirtualHost>
entries that have been
configured with the Apache ServerPath
directive.
Copyright © 2000-2005 Cursor Software Limited.
Copyright © 1999 Francis J. Lacoste and iNsu Innovations Inc.
All rights reserved.
This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. You may refer to either version 2 of the License or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.