home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Spezial
/
SPEZIAL2_97.zip
/
SPEZIAL2_97.iso
/
ANWEND
/
ONLINE
/
SREFV12J
/
SREFAST.DOC
< prev
next >
Wrap
Text File
|
1997-07-06
|
19KB
|
392 lines
06 Jul 1997
The SREFAST variant of SRE-Filter.
1) Introduction
SREFAST provides faster throughput for a user-specified subset of
selectors. The operative assumption is that many requests are "simple",
and do NOT require the full power of SRE-Filter. If you can specify which
selectors fall into this "simple request" category, then it makes sense
to use a low powered (but faster) filter to deal with them.
Use of SREFAST requires that the site administrator specify which selectors
SREFAST should attempt to process. However, for requests that are
NOT "specified", and for requests that are too complicated, SREFAST will
simply pass the request to SREFILTR for normal processing.
Thus, you will never loose functionality by using SREFAST.
To use SREFAST, you'll need to set GoServe's Filter to be SREFAST.80.
More importantly, you'll need to specify the selectors to treat
as "simple requests". The easiest way to do this is to run the
SREFST configurator (SREFAST.HTM). Section 3 contains a detailed
description of configuration options.
SREFAST can be seen as a more flexible alternative to SREFQUIK.
It's disadvantage is that it demands more careful configuration.
** We recommend careful reading of the hints and cautions section at the **
** end of this document. **
2) Features of SREFAST
The major feature of SREFAST is that it's much smaller then the main
SRE-Filter program (SREFILTR.80). Loading, and executing, SREFAST will
therefore take less time.
This smallness means that it doesn't do nearly as much as SREFILTR. However,
it does have several features, including:
* Most of the common server side includes will be processed, using a
simple caching algorithim.
* Requests can be redirected
* Virtual directories can be specified
* A simple form of access control is available
* Non standard mime types can be specified.
* Post-filtering (recording in log files) can be suppressed
MOST IMPORTANTLY, for requests that SREFAST can't/won't deal with, the
regular SRE-Filter is called. Thus, you need not loose functionality.
Notes:
* When starting SREFAST, you must shut down GoServe. That is,
do not start SREFAST by changing the FILTER tab while
running another filter.
* SREFAST does not check SRE-Filter's load balancing. However,
if SREFILTR is called, load balancing will be checked.
* SREFAST does not call SRE-Filter's PRE-Filter. However, if
SREFILTR is called, PRE-Filter(s) will be run.
3) Configuring SREFAST
Configuration of SREFAST requires modification of the INITFAST.80
configration file. This modificaiton file can be readily accomplished
by using the SREFAST configurator (SREFAST.HTM, located
in your GoServe data directory).
Using INITFAST.80, a special "binary" configuration file is created.
This binary file contains a REXX stem variable, hereinafter referred to
as the DOIT. variable. Each request recieved by SREFAST is
compared to entries stored in the DOIT. stem variables (as read from the
binary configuration file). If a match is found, the instructions
contained in the matching entry will dictate how the request is to be
handled. If there is no match, then SREFILTR.80 is immediately called.
The following describes the possible "options" that DOIT. may contain.
SEL: Required. The target "selector".
The selector requested by the client will be compared against
SEL.
* You can include * (wildcard) characters in SEL.
SERVER: Optional. The numeric IP address, or Host alias, this
entry is valid for.
If you are NOT running multiple hosts,
you should NOT specify a SERVER variable.
* If SERVER is not specified, the entry is valid for all
+requests.
* Otherwise, it's value will be compared against the numeric
IP address of the target server (as provided by GoServe), and
the HOST: request header (if one exists).
* If SERVER is specified, and neither the numeric IP address
or the HOST: request header match the value of SERVER,
this entry will be ignored.
HOST: Optional. The "host nickname" of the SERVER.
If you are NOT running multiple hosts,
you should NOT specify a SERVER variable.
* HOST is only used to resolve REPLACE variables in
server side includes. If you specify a SERVER but
not a HOST, the "generic host" variables will be used.
* We highly recommend coordinating the values assigned to
SERVER, HOST, and DIR with the HOSTS. entries (in
INITFILT.80)
DIR: Optional. The directory containing the requested file.
* If not specified, the GoServe default data directory is used.
* If DIR starts with a url (that MUST begin with http://),
then requests that match this entry will be redirected to
this URL.
* When redirecting, you can include an * at the end of DIR to
"append the selector" (or the file portion of the selector) to
the target URL.
DIR_NAMEONLY: Optional. Modifies the DIR option.
When mapping requests to files, SREFAST can use the value of
the DIR option in two ways:
i) It can append the selector
ii) It can append <u>just the file name</u> portion of the
selector
DIR_NAMEONLY controls which method to use; if DIRNAME_ONLY is
selected, then method ii is used.
Example: Assuming DOIT.1.!DIR='D:\PERSONAL' and the selector
is /STUF/FOO.BAR, then the following are returned:
If DIR_NAMEONLY=0, D:\PERSONAL\STUF\FOO.BAR
If DIR_NAMEONLY=1, D:\PERSONAL\FOO.BAR
* The default value, used if DIR_NAMEONLY is not specified, is 0.
* If DIR is not specified, DIR_NAMEONLY is ignored.
SSI: Optional. If set to 1, then this entry contains server side
includes.
* SREFAST uses "pre-compiled" cache files to handle most
server side includes.
* If SSI=1, and if SEL contains wildcards, then multiple cache
files will be created.
MIME: Optional. Mime type. The Mime type of this request. If not
specified, the standard SRE-Filter mime type is used.
USERS : Optional. A space delimited list of allowed users.
* If the client did not provide a username, the main
filter (SREFILTR) is called. SREFILTR may then
return an authorization request.
* If this username is in USERS., then PWDS is also checked.
PWDS: Optional. A list of allowed passwords, with each word in the list
paired with the corresponding word in USERS.
* Given that USERS is satfisfied,the appropriate word in PWDS is
compared against the password provided by the client.
* If this word does not match the password, then the main
filter (SREFILTR) is called.
* A value of * means "any password will do".
NOCACHE: Optional. If set to 1, then this entry will NOT be cached
by GoServe.
NORECORD: Optional. If set to 1, then this entry will not be recorded.
That is, no POST-Filter action will occur: no recording in
the RECORD_ALL file, no recording in the .LOG files, etc.
Otherwise, the entry WILL be recorded (using the standard
SRE-Filter mechanisms).
TRIGGER: Optional. If filled in, this should contain
the fully qualified name of a trigger file. When SREFAST
checks it's SSI cache, it always checks the file-stamp of the "own
file"; and will not use the cache entry if the file stamp has
changed. However, if an INCLUDEd file has changed, SREFAST
will not detect the change; and will instead use the out-of-date
cache entry. By using a trigger file, you can specify one
additional file-stamp to check (i.e.; an INCLUDEd file).
Notes:
* DOIT. stem variables have the form:
DOIT.nn.!tail
where nn is an integer, and tail is one of the options listed above
* DOIT.0 entry should be set to the number of DOIT. entries.
* SREFAST uses a "first match" criteria -- the first match to the
requested selector is used. That is, "best matching" is NOT attempted.
* Entries with NOCACHE=1, or with USERS (and PWDS) entries will NOT
be cached.
* We HIGHLY RECOMMEND enabling (and using) GoServe's cache whenever
possible (that is, when security requirements are not binding).
Note that documents with "dynamic server side includes" are never
cached, but documents with "static" server side includes may
be cached.
Examples (note that case does not matter):
DOIT.0=6
DOIT.1.!SEL="/"
DOIT.1.!DIR="http://my.site.net/index.htm"
DOIT.2.!SEL="index.htm"
DOIT.2.!SSI=1
DOIT.2.!MIME="text/html"
DOIT.3.!SEL="IMGS/*.GIF"
DOIT.3.!DIR_NAMEONLY=1
DOIT.3.!DIR="d:\IMGS\"
DOIT.3.!MIME="image/gif"
DOIT.3.!NORECORD=1
DOIT.4.!SEL="BBS/BBS.HTM"
DOIT.4.!SSI=1
DOIT.4.!USERS="JOE FRANK BOB "
DOIT.4.!PWDS=" EOJ CRAB * "
DOIT.5.!SEL="HELLO.HTM"
DOIT.5.!SERVER="OUR.SITE.NET"
DOIT.5.!DIR="D:\WWW2\"
DOIT.5.!MIME="text/html"
DOIT.6.!SEL="/HELLO.HTM"
DOIT.6.!NOCACHE=1
Notes on examples:
* The "number of words" in DOIT.4.!USERS must match the number of
words in DOIT.4.!PWDS
* Use of a leading / in DOIT.n.!SEL is optional (leading /'s are
ignored).
* DOIT.5 applies only to requests to the OUR.SITE.NET host.
* If DOIT.6 and DOIT.5 had their number reversed, then the OUR.SITE.NET
entry would NEVER be found (since the "generic" HELLO.HTM would
be the first match).
* A DOIT.7 entry would NOT be examined (since DOIT.0=6).
* You could create a text file similar to the above, and use the
SREFAST configurator to transform it into a "SREFAST configuration
file".
4) SREFAST and Server Side Includes
To expedite processing of server side includes, SREFAST will start a special
"html compiler" daemon. This daemon (running in a seperate thread) will
examine the INITFAST.80 configuration file and determine which files are to
be processed for server side includes. It will attempt to do this
processing, and will save results to special cache files.
When a request for such an SSI file arrives, SREFAST will read the
appropriate special cache file. It will then check for a few simple
"dynamic" string replacements, and send the document to the client.
If an html file contains a SELECT, OPTION, #EXEC, or INTERPRET keyphrase;
then this file will NOT be processed by SREFAST. That is, the main filter
(SREFILTR.80) will be used to process documents that contain any of these
four keyphrases. Therefore, it is pointless and wasteful to specify
DOIT. entries that refer to HTML documents that contain any of these 4
keyphrases.
Notes:
* SREFAST does NOT check "trigger files". It does check the "own"
filestamp (mismatches cause the main filter to be called).
Otherwise, SREFAST assumes that the special cache file (created by
the "SREFAST SSI daemon") is correct.
* In order to prevent this cache from becoming seriously out of date, the
daemon will refresh the cache periodically (by default, every 15 minutes).
You can change this refresh rate by changing the REFRESH variable
in SREFAST.80.
* Almost all of the REPLACE keyphrases will be processed. The exception is
the HITS and COUNT keyphrases -- if such as keyphrase is found,
then SREFAST will not process the document.
* If there are NO dynamic replacements (and none of the verboten
keyphrases), SREFAST will instruct GoServe to cache the "compiled"
document. Note that versions of GoServe older then 2.50 might fail
to recognize when a change occurs in a "cached, pre-compiled HTML
document".
* To force SREFAST to "recompile", you can delete all files with a
.FST extension in SRE-Filter's TEMPDATA_DIR directory (typically,
x:\goserve\temp).
5) Hints and Cautions
* SREFAST should be used with SRE-Filter version 1.2j (and above).
* It may take a minute or so (depending on how many SSI entries you have)
for SREFAST to initialize. We recommend immediately hitting your server
with a request (any request) after starting GoServe with SREFAST. This
can be easily done with DOGET.CMD (DOGET.CMD is an SRE-Filter
utility installed into your GoServe working directory).
* When SREFAST processes a request, most of SRE-Filter's parameters
are NOT checked. In particular:
** ALIASES are NOT checked
** VIRTUAL directories are NOT checked (see below for an
exception)
** ACCESS controls are NOT checked
** The USER database (and associated privileges) are NOT used
** Pre-filter processing is NOT attempted
** The SAVE_STATE and HIT_SUPERUSER_SUPPRESS features are NOT used
** PUBLIC_URLS are not checked.
There are a few exceptions:
** OWNERS are recognized (OWNERS are not checked for USERS).
** Virtual directories WILL be used when resolving the INCLUDE and
#INCLUDE SSI keyphrases.
** Post-filtering options (WRITE_LOGS, RECORD_OPTION, POST_FILTER,
POSTFILTER_NAME,RECORD_ALL_FILE, and HIT_OWNER_SUPPRESS) will
be used (and if you specify a .!HOST field, it's value will
be used as a host-nickname when looking up these
post-filtering options).
* By default, SREFAST assumes that .HTM and .HTML documents do NOT have
server side includes. To force SREFAST to process SSI's, be sure to
set the !SSI option.
* If you have specified a lot of !SSI files (say, you used wildcarded a
large directory), you may need a fair amount of disk space to store
the cached files. As a precaution, SREFAST will always leave about
10M free (see the DISK_FREE variable in SREFAST.80) on the
temporary data directory disk (it's where the cached files are written).
If this limit is exceeded, cached files will not be written.
* SREFAST does somee checking of "trigger" files: SREFAST will check the
"own" file, and (optionally) one "trigger file". If the file stamp of
either of these files differs from what is stored in the cache, then
SREFILTR is called.
Note that (unlike the SREFILTR SSI cache), INCLUDEd files are NOT
automatically checked. In other words, if your site has ever
changing "included" files, it is quite possible that slightly out of
date information may be sent to the client.
* SREFAST will frequently check (about once a minute) to see if any of
several configuration files have changed. If a change is detected,
SREFAST will regenerate the binary configuration file (which means
that it will recreate the SREFAST cache).
Furthermore, about once an hour SREFAST will regenerate the binary
configuration file, even if no change has been detected (this limits
how "out of date" your SREFAST cache can become).
Ambitious administrators can change these limits by modifying the
REFRESH and FORCE_REFRESH variables in SREFAST.80.
A Recommendation:
IF A DOCUMENT HAS INCLUDED FILES THAT CHANGE RAPIDLY, SREFAST
SHOULD NOT PROCESS IT.
* SREFAST will NOT attempt to process the following requests:
** !SPECIAL requests
** POST, PUT and DELETE method requests
** CGI-BIN requests
** Selectors that contain a ?
* On occasion; such as on transaction #1, or while the cache is being
refreshed, the main filter will be called even when a matching SREFAST
entry exists. Therefore, we strongly advise that you "synchronize" the
various features of SREFAST with the corresponding features in the
"main" SRE-Filter's various configuration files.
For example:
i) Double check that the security features of SREFAST are
synchronized with those in SRE-Filter. That is, the !USERS and !PWDS
should be the same as entries in the USERS.IN file.
ii) !NOCACHE and !SSI options should be synchronized with the
SSI_SHTML_ONLY option, and with the various "access control
permissions".
iii) !HOST and !SERVER options be the same as listed in the HOST. options.
iv) !DIR should yield the same results as SRE-Filter's virtual directories
and aliases.
v) The value of VERBOSE in SREFAST should correspond to it's value in
INITFILT.80.
Basically: when configuring SREFAST to accept "complicated" requests,
you might want to test your server's responses under both SREFAST and
SREFILTR.
* Use of * in Selectors with SSI's will lead to seperate cache entries for
each matching file.
* When transferring "dynamically cached SSI" documents, SREFAST will
send the document in pieces if the SREFILTR variable DO_SEND_PIECE=1.
* You can create a short list of UNALLOWEDIPS -- see SREFAST.80
for details.
* You can use SREFAST.HTM to check the proportion of requests handled
by SREFAST.
Remember: if the proportion of requests handled by SREFAST is low,
it may be more efficient to use the standard filter!
--- End of file.