The SRE-FILTER for GoServe
version 1.2h
Introduction
SRE-FILTER
is a full featured, and (hopefully) easy to configure,
HTTP (Web) Server for OS/2. Written in
REXX,
SRE-FILTER is designed to run under the
IBM EWS GoServe program.
SRE-FILTER provides a
number of useful features including:
This document describes how to use SRE-FILTER.
While not necessary,
the reader should first examine
the documentation that comes with GoServe (GOSERVE.DOC and GOHTTP.DOC). Knowledge of the
REXX
programming language would also help. However, you can still do a lot of nice stuff with only a
rudimentary understanding of GoServe, or of REXX. Lastly, if you don't know
HTML, the
"markup language" of
the world-wide web (WWW), then it's going to be hard to do anything interesting!
Before reading this manual,
you might want to peruse the SRE-Filter
users guide
Other useful documentation files include:
Other GoServe filters.....
A popular alternative to this
filter is Don Meyer's
GoHTTP HTTP filter system.
GOHTTP offers
CGI-BIN and HTTPD compatability, and extensive auditing.
Another alternative is
the InterFilt filter of Derek Sims. It has good support for multiple realms and
multiple hosts, but lacks server side includes and other features.
A Note to upgraders
CHANGES.DOC
lists the recent changes (from ver 1.2d on), or see
CHANGES0.DOC
for a summary of changes between versions
ver 1.11 (1 June 1996) to ver 1.2d (15 Sept 1996).
Table of Contents
Installation Notes
SRE-FILTER consists of several filter
program files
(SREFILTR.80, SREFMON.CMD, and others), as well as
a set of files containing external routines and
samples of initialization databases.
As noted above, you'll need the
GoServe
package (ver 2.47 or 2.48 is recommended).
- For convenience, let us assume that the GoServe package has been installed in the
\GOSERVE directory (your working directory), the
data directory is set to \WWW, and GoServe
is running on port 80 (in HTTP mode).
- Copy the SREFILTR.ZIP file to a temporary directory and then
unzip it in the usual manner (i.e.;
UNZIP SREFILTR)
.
From an OS/2 prompt, run INSTALL (a REXX program
bundled with SRE-FILTER),
and follow the on-line instructions. You will be asked to provide the
names of several directories.
If you select the defaults, INSTALL will create
the following directories (you select which drive):
- \GOSERVE\DATA : Contains various dynamic GoServe data files: such as
the USER_FILE,
COUNTER_FILE,
RECORD_ALL_FILE,
and the ACCESS_FILE.
- \GOSERVE\MESSAGE :contains the message boxes
- \GOSERVE\CONFIGS :contains the simple-mode configurator support files/A>
- \GOSERVE\TEMP : Storage for temporary data files (such as the
"recent hits" cache). The $xx.80 temporary response files are also
stored here.
- \GOSERVE\MAIL: the in-box for an SMTP server
- \GOSERVE\CGI-BIN : Location for CGI-BIN programs
- \GOSERVE\UPLOAD : Used to store uploaded files.
- \WWW\SAMPLES : Location of sample files, and SRE-FILTER documentation.
- \WWW\TEMP : Work area, used for temporary file creation by server side programs.
- \WWW\IMGS : Location of icons (.GIF files) used by SRE-FILTER
After running INSTALL, you can delete the contents of this temporary directory.
- Set up GoServe to run SRE-Filter:
- Set the
filter
to be SREFILTR.80. To do this,
you can insert http filter srefiltr.80 in the
optional parameters line in GoServe's settings window
(right-mouse click on the GoServe icon ...)
- In certain cases, throughput can be markedly
improved by using the
SREFQUIK.80 variant of GoServe.
- If you intend to run "server-side" programs, you might want to
increase the following
Limits
:
-
End client after inactive
-
End client after total
- Double check that the
DataDir
option points to the directory containing your
HTML files (for example, /WWW).
- It is HIGHLY recommended that the
Data Directory and the
Working Directory be
different!
- You might want to turn on GoServe's caching; if you want to
record requests, you should also select the
call
filter anyways
option.
- To view a running log of SRE-FILTER's actions, run the
PMPRINTF
program.
- At this point, the default version of SRE-FILTER is running! You'll probably
want to change the values of a number of SRE-FILTER's parameters. Although you can do this by
editing the various parameter files (such asINITFILT.80)
with a text editor, for the new user
it is probably easier to run CONFIGUR.HTM -- a HTML front-end to
SRE-FILTER's built-in configurator.
The most straightforward way of doing this is:
- Make sure that GoServe is running on your server, with SREFILTR.80 as it's filter.
- From your server machine, run your favorite web browser
(say, Web Explorer 1.03).
- Point it at http://your.server/CONFIGURE (where your.server is the address
of your http server).
- You will be given the choice of a simple, intermediate, and expert mode
configurator. The simple mode is best suited for new users; it's a bit cumbersome
when making large changes, but is very well documented.
- Hint: If the configurator won't let you in (due to insufficient
privileges), you might want to check the OWNERS variable (in INITFILT.80)
to be sure it points to your server machine's IP address. Alternatively,
you can edit the SRE-Filter username file (USERS.IN, in your \GOSERVE\DATA
directory), and add a SUPERUSER to it.
- If you need to use a port other then 80, you should:
- Change the names of all SRE-FILTER files that end with
.80 to be the .nnn, where nnn is the
desired port (nnn
can be > 3 digits if HPFS is being used).
In particular, change
SREFILTR.80 and INITFILT.80
- Enter
PORT nnn FILTER SREFILTR
in the optional
parameters
setting of GoServe.
- Note that it is possible to run multiple instances of the GoServe and
SRE-FILTER;
using different ports, different working directories (and
possibly different data directories), and different copies of the
user-configurable files (the .IN, .CTL, .CNT, and INITFILT.nnn files).
- Remember, when using a port other then 80, clients will
need to include
:nnn
in the IP address of your server.
Now, all you have to do is create some informative, efficiently organized, and eye-catching HTML
documents, paste them together, and add links to the rest of the
net. But that's the fun part.
Description of the files that comprise SRE-FILTER
The SRE-FILTER package consists of a number of files. These include
the SRE-FILTER REXX programs, the macrospace
procedure library, several user-configurable parameter files, samples of
"counter and control" files, and some sample HTML files. A complete
description of these files is contained in the
file list.
Many of the directories, and files, mentioned above can have their names changed
by modifying variables that are located in INITFILT.80 (the INITFILT_FILE); either by editing
the file with a text editor, or by using CONFIG2.HTM. In this documentation
we usually refer to files and directories by their "titles" (such as working directory), but occasionally the "default name" is used
(such as \GOSERV).
If you change the names of your directories, keep the following in mind:
- If you intend to make temporary files available to clients,
the TEMPFILE_DIR directory should
be a subdirectory of the GoServe data directory.
- For SRE-Filter's documentation and examples to work properly,
the IMGS and SAMPLES sub-directories should be directly under the
GoServe data directory
To speed up processing, and to facilitate modularization, SRE-FILTER makes
extensive use of REXX macrospace.
Of greater import, SRE-Filter uses several "helper" threads to handle
username lookup, alias matching, SSI-document caching,
URL specific access control, virtual
directory matches, and post-filter processing. These threads are
generated upon the first request to SRE-Filter. In addition,
SRE-Filter stores a number of variables in the local (GoServe) environment.
For most users, these implementation
details are unimportant. However, these
threads do use system resources (queues) which remain alive even after
GoServe has been turned off. To free these resources, it is recommended
that the FREEUP.CMD program be run after GoServe has been killed.
Citation:
SRE-FILTER uses the REXXLIB library to access macrospace and to
generate/communicate between threads. A copy of REXXLIB is supplied
with SRE-Filter, and may be used freely with SRE-Filter. If you wish
to use REXXLIB in other REXX programs, contact
Quercus Systems for licensing information.
Lastly, SRE-Filter monitors the parameter files, including INITFILT.80.
Changes to these files will be incorporated into SRE-Filter's parameters
about every 10 seconds.
Variables and Parameters
Throughout this documentation reference is made to variables used to change SRE-FILTER's
parameters. These are set in INITFILT.80,
which can be edited with your favorite text editor,
or modified using CONFIG2.HTM (as mentioned above).
Return to table of contents
Dynamic document creation (server side includes)
Perhaps the greatest advantage of SRE-FILTER is the extensive support for
dynamic document creation. In particular,
server side includes of files, text
strings,
and transient variables (such as the time, date, and number of requests)
are easy to accomplish, requiring modifications to your HTML documents, and
not to the server software.
The basic idea is that when writing an HTML document,
special keyphrases are inserted. When the document is
requested, SRE-FILTER will detect these keyphrases,
and perform the desired action.
The basic structure of a keyphrase is:
Delim1 KEYWORD
argument
Delim2
where:
- Delim1 and Delim2
are single character (or multi-character) delimiters
that mark the beginning and end of a keyphrase.
By default, one set of delimiters is available (this can be changed
by modifiying INITFILT.80):
- <!-- and -->
Cautious users should use the <!-- and --> delimiters, which
are also the "comment" flags of HTML.
- KEYWORD can be one of several phrases:
- SELECT -- used to selectively include blocks of HTML code
- REPLACE -- used to "replace strings"
- INCLUDE -- used to "include files"
- OPTION -- used to "include
options sent by the
client"
- INTERPRET -- used to "include
the results of a custom-designed REXX routine"
- CACHE -- controls SRE-Filter's
server side include CACHE
- #cmd -- NCSA HTTPD style server side includes
Note: If desired, you can add a "preface" (such as the !
character) to the definitions of the first five keywords (i.e.; !REPLACE
is used instead of REPLACE). See the description of the KEY_PREFACE
variable in INITFILT.DOC for details.
- argument is a string containing "arguments" that are used, in
conjunction with the keyphrase, to dictate how SRE-FILTER should modify
this document.
Examples:
<-- REPLACE CREATION_DATE -->
<-- INCLUDE ADDLIST.HTM -- >
<-- #FLASTMOD FILE="INDEX.HTM" -->
When SRE-FILTER finds a keyphrase, it will ALWAYS remove the keyphrase, and replace
it with the file or string dictated by the KEYWORD
argument . This replacement occurs at the position in the document that was
occupied by the keyphrase. If a faulty keyphrase is encountered
(i.e.; a non-supported argument is used),
SRE-FILTER will remove it.
The SELECT keyphrase is a little different: it dictates whether the "block of
HTML code" that follows the SELECT keyphrase is to be retained. Thus, it is
best thought of as a "server side exclude" -- the keyphrase is always removed, but
sometimes so is a lot of other stuff!
The CACHE keyphrase is used to control SRE-Filter's caching of documents that
contain server side includes.
The NSCA HTTPD style server side includes are provided for completeness sake; some of
them are redundant with REPLACE and INCLUDE.
Headers and Footers
In addition to server side includes using keyphrases, a multi-line header and
footer can be automatically added to all HTML
documents. The header is added just after the (first) <BODY >
tag in the document (see the notes for an exception to this rule); and the footer is added just before the (last)
</BODY > tag.
To set these, just change the values of the HEADERS.
(for headers) and the FOOTERS. (for footers)
stem variables located in INITFILT.80.
Notes:
- Headers and Footers can contain keyphrases.
- To suppress addition of a header and/or a footer,
set HEADERS.1=0 and/or FOOTERS.1=0.
- If the HEADER starts with
<BODY>, then the HEADER will replace the first <BODY> element.
-
The various server-side includes are only attempted for HTML files.
-
If you will NEVER have server-side includes, you can set the
NO_INCLUDE variable to equal "YES". This will speed up request
processing a bit.
- HEADERS., FOOTERS., and NO_INCLUDE can be host specific (see INITFILT.DOC for details).
Description of Keyphrases
The REPLACE keyphrase
Syntax: <!-- REPLACE Varname -->
, where Varname
is
the name of a static or dynamic variable.
The REPLACE keyword is used to insert dynamically determined information
and short (static) strings into a document.
SRE-FILTER recognizes the following "built-in" Varnames
:
- DATE : todays date (i.e.; 27 Aug 1988)
- TIME : current time (local) (i.e.; 4:54pm)
- DATEGMT : current date (at GMT)
- TIMEGMT : current time (GMT) -- a GMT is appended
- CREATION : Short message stating (local) creation time and date of the document
- CREATION_DATE : Creation date of document
- CREATION_TIME : Creation time of document
- SERVERNAME : The IP name of the server (i.e.;
WWW.MYORG.NET). If multiple hosts, this will
be the IP name of the server to whom the request was directed.
- SERVER : the server software (i.e.
GOSERVE ver. 2.45 )
- WEBMASTER : The Webmaster's address **
- USERNAME : The client's name, i.e. johndoe.somewear.net
(or his numeric ip address if a name is unavailable)
- HOME_NAME : The host specific colloquial (not necessarily IP) name of this
domain **
- URL : The current URL (includes the servername and serverport)
- BROWSER: The name of the web browser the client is using
(sometimes referred to as the 'User-Agent')
- FILTER_NAME : The name of the filter (i.e.; SRE-FILTER ver 1.2).
- REFERER : The address of the server that refered the client to your site
(often unavailable).
- INHOUSE.n : n = an integer. If the user has INHOUSE
privileges (but does not have SUPERUSER
privileges)
then replace with the INHOUSE.n variable **
- SUPERUSER.n : n = an integer. If the user has SUPERUSER
privileges
then replace with the SUPERUSER.n variable **
- HITS and HITS_FILE: A string stating the number of hits
for the "URL" or the file (respectively),
being requested (the number of hits is stored in the
COUNTER_FILE ).
Note that
a given document may be reached via several different URLs (say,
due to several aliases pointing to the same file), each of which
will have a seperate counter. In contrast, each FILE has a
unique counter. Also note that on multiple host servers,
otherwise similar URLS (that may even point to the same file)
will have seperate URL counter entries -- but (if they do point
to the same file) will have only one FILE entry.
- COUNTS and COUNTS_FILE: Same as HITS, but just the number is displayed.
- OPTION_COUNTS.n and OPTION_HITS.n :
Normally, the same as COUNT and HITS. But, if an option
has been recieved, use the value of the nth
option (rather then number of hits).
- READ_HEAD : Displays (using a <PRE>> format) the "request
header". This can be a handy debugging tool.
- PREFILTER_RESULT : Displays "status" message returned by the
PREFILTR routine. If the PRE_FILTER variable
equals NO, PREFILTER_RESULT will be an empty string.
A special argument can
be used to extract
variables from the GoServe environment, which
contains many variables created by SRE-Filter.
- VARIABLE.varname will extract the varname
variable, where varname is either in the GoServe/SRE-Filter environment,
or a value hard coded in SREFILTR.80.
For example,
VARIABLE.HOST_NICKNAME refers to "host nickname" (if available) to whom
this request was directed.
Last of all, if none of the above matches argument , the
REPSTRGS_FILE is searched for a
match (which might be host specific). If a match is found, the
information from this entry in REPSTRGS_FILE is used.
See REPSTRGS.IN for the details!
Notes
- The **'ed variables are user-configurable "static" variables that
can be modified by editing INITFILT.80, or by
using CONFIG2.HTM. All of them may be host specific.
- To create a host-specific "static" variable,
you should include
a .HOST_NICKNAME. For example, for a host with a nickname of
ZOO, the WEBMASTER should be specified (in INITFILT.80) using:
WEBMASTER.ZOO='MANAGER@ZOO.YOURSTATE.ORG'
.
If a matching
host-specific entry does not exist, the "generic" entry (in this case,
WEBMASTER) would be used.
- Both "built-in" and "user-defined in the REPSTRGS.IN file" variables
can be host specific (using the above syntax in both cases).
- When including static variables in your HTML documents,
the .HOST_NICKNAME should not be appended!
For example, if the ZOO host is asked for INDEX.HTM, and INDEX.HTM
containsthe tag:
<!-- REPLACE WEBMASTER -->; SRE-Filter would look up the value of the
WEBMASTER.ZOO variable.
In contrast, if the tag were: <!-- REPLACE WEBMASTER.ZOO -->
SRE-Filter would look for WEBMASTER.ZOO.ZOO.
-
Dynamically determined information consists of variables that are
determined at the moment the request is recieved. For example:
<!-- REPLACE TIME
-->
will cause the current (local) time to be placed in the document.
- Static information is the same for all requests (to a given host). Inclusion of
static variables can be a great convenience when writing sets of HTML
documents, especially if phrases that occur in all these documents are subject to
frequent change (say, a daily message).
- The HIT_CACHE_LEN and HIT_OWNER_SUPPRESS variables can be used to reduce the
number of false hits.
Return to table of contents
The INCLUDE keyphrase
Syntax: <!-- INCLUDE FileName -->
, where FileName is
the name of the File to be included.
The INCLUDE keyphrase instructs
SRE-FILTER to include the contents of a file
into the requested document
(where argument is the file-to-be-included).
For example, INCLUDE PHONE.LST
would cause the contents of the file PHONE.LST
(in your data directory) to be inserted into the
document.
Notes
- It is recommended that
INCLUDE keyphrases appear on seperate lines of a file (with no other HTML
statements or text).
The file is treated as a long string (that contains linefeeds)
and replaces the keyphrase -- anything before or after the keyphrase
(on the same line) will be placed just before and after the contents of
the file.
- FileName is interpreted relative to the Data Directory, or
to a "local" virtual directory .
- INCLUDE, in combination with the INTERPRET keyphrase, facilitates
customization of your documents , based on client specific informaton
(such as the
user agent
!
Return to table of contents
The OPTION keyphrase
Syntax: <!-- OPTION n -->
, where n is an integer.
The OPTION keyphrase instructs SRE-FILTER to insert the contents of
the n'th OPTION into the document.
OPTIONs are contained in the portion of the request string
following the ? character.
How to pass OPTIONs to a document
To pass OPTIONs to a document, the
request string
should have the form:
HTMLFILE.HTM?Your+OPTION+1&OPTION2
- In this example ....
OPTION 1
keyphrases in HTMLFILE.HTM
would be replaced with the string Your OPTION 1
-
OPTION 2
keyphrases in HTMLFILE.HTM
would be replaced with OPTION2
.
-
OPTION 3
keyphrases in
HTMLFILE.HTM will be removed (since only two options appear in
the request string).
- URL character decoding
is done on the string following the ? character.
- You can have as many OPTIONs as you like, each seperated by a &.
OPTIONs and searchable indices.
When a browser responds to document containing the <ISINDEX >
element, the request string will have the same
HTMLFILE.HTM?word1+word2
format. In order
to properly respond to such "searchable index generated" responses, you should set up an
ALIAS
Notes
- OPTIONs can be useful as a simple means of keeping track of where
the client came from. For example, you can use the OPTIONs keyphrase
to include message about "where you came" from in linked
documents.
The SAMPOPT1.HTM and SAMPOPT2.HTM files bundled with
SRE-FILTER demonstrates this use of OPTION.
Another example (albeit trickier), is to use
OPTION keyphrases to customize URLS, with the goal of helping
the client return to one of several potential "invoking"
documents.
- The OPTIONs are stored in the OPTLIST. REXX "stem" variable,
with OPTLIST.0 containing the number of OPTIONs recieved.
This information can be used in INTERPRET keyphrases to help customize
documents.
Return to table of contents
The INTERPRET keyphrase
Typical syntax: <!-- INTERPRET FILE xxx.RXX -->
INTERPRET provides a means of including and executing
a REXX-code-block
There are two major variants of the INTERPRET keyphrase:
-
INTERPRET CODE statment 1 ; statement 2 ; ...
;
where each statement n
is a valid REXX statements (and
each statement is seperated by a semi-colon).
For example:
INTERPRET CODE tmp1=server() ; interpret.result=tmp1
-
INTERPRET FILE Filename arg_list
,
where: -
Filename
is a file containing REXX code
(filename
is assumed to be relative to the working directory,
or to a "local" virtual directory).
-
arg_list
is an optional comma delimited list of
"arguments"
Example
- If your document contains the keyphrase:
- <!-- INTERPRET FILE GOBED.RXX-->
- and GOBED.RXX contains:
- tmp1=time('h') ; if tmp1<6 | tmp1>23 then
interpret.results=" <em> It is late, GO TO BED! </em> " ;
then the phrase It is late, GO TO BED! will appear in your
document whenever your local time is between 11:00 P.M and 6 A.M.
In general, the INTERPRETed REXX-code-block
should include one or more of the following:
- A SAY or AUDIT command (for writing status messages)
- Assignment of a (possibly multi-line) string to
the INTERPRET.RESULTS variable. The contents of
INTERPRET.RESULTS is
written into the document (at the location the keyphrase occupies).
- A QUEUE (or PUSH) command -- with each QUEUEd (or PUSHed) string
automatically appended to INTERPRET.RESULTS (see the discussion of
the USE_STDOUT variable in INITFILT.DOC for more details on this #EXEC-like
feature)
- RETURN 'stuff to include'
Notes:
- When processing a REXX code-block, syntax checking is turned on -- coding
errors will cause the code-block to fail, but will not crash GoServe.
INTERPRET FILE
blocks are "interpreted"
by SRE-Filter -- they are not called as external procedures.
Therefore: an INTERPRET FILE code-block
can not contain
procedures or subroutines
This inconvenience can be partially ameliorated by calling "external" procedures from
within the INTERPRET FILE code block.
- If a
RETURN
is encountered in an INTERPRET file, the "returned"
string is used as the server side include (INTERPRET.RESULTS and QUEUE
actions are ignored).
- The comma delimited
arg_list
can be accessed using
the usual REXX
syntax (i.e.; parse arg aval1,aval2
). You can
include up to 10 arguments.
- The following functions and variables can be accessed by a REXX code block:
host_nickname
: The host nickname (useful on multi-host servers)
servername
: IP name of the server (useful on multi-host servers)
host_nickname
: SRE-Filter's host nickname (for this servername
)
-
optlist.
: The option list stem variable (the "options"
following a ?
in the request string).
-
privset
: A list of the client's privileges
-
verbose
: The VERBOSE variable (higher values for more PMPRINTF output)
-
docname
: The "action" portion of the request string
-
usedfile
: The fully qualified name of the requested file
-
Get_value(env_var)
: The GET_VALUE
function will return the value of
an SRE-Filter "environment" variable.
- You can access the GoServe functions (such as the REQFIELD function).
There are several SRE-FILTER procedures, including string manipulation routines,
that you may find useful.
-
INTERPRET
will be ignored if NO_PROCESSING='YES', or if a NO_SSP permission applies to this URL
-
INTERPRET CODE
keyphrases will be ignored if
NO_INTERPRET_CODE='YES', or if a NO_CODE permission applies to this URL.
Note that INTERPRET FILE keyphrases are not effected
by NO_INTERPRET_CODE
- When using
INTERPRET CODE
:
each statement must end with a semi-colon.
- If your needs are complicated, you might want to
write your own SRE-Filter add-on; typically this would be a
REXX routine that would generate an HTML document that SRE-Filter
would then return to the client
However, when combined with the other keyphrases, the INTERPRET
keyphrase can accomplish quite a bit of customization!
- DIRINFO.RXX, USETABL2.RXX, and ADDPRIVS.RXX are samples of
INTERPRET FILE
files (ADDPRIVS.RXX uses the arg_list
).
- Obsolete: An INTERPRET_FILE can be used to store
small rexx-code-blocks using a "label" system. However, we no longer
recommend this method.
Return to table of contents
The SELECT keyphrase is qualitatively different from the other keyphrases -- it
acts as a "conditional server side exclude" of HTML code that is already
in your document.
The power of SELECT is the ability to check dynamic variables (such as the
client's IP address, or his user agent), and retain or exclude a portion of the HTML document
accordingly.
A SELECT keyphrase expects an argument containing a block of REXX code, just
like the code blocks used in the INTERPRET keyphrase. This
block of code will be interpreted
. The code block
should "exit" with either a RETURN 1
or
RETURN 0
, where:
RETUR 1
: the subsequent HTML text block
is retained
RETURN 0
:the subsequent HTML text block is
deleted.
The "subsequent HTML text block" is delimited by a
SELECT END
keyphrase, and
can be of any length (if no SELECT END
keyphrase is encountered, the remainder of the file is dropped).
Lastly, if there is no RETURN, the code block is retained (i.e.;
the default is RETURN 1).
Example:
<!--SELECT tmp.1=extract('clientaddr') ;
if wordpos(tmp.1,owners)=0 then return 0; -->
<em> Hello! You have SuperUser Privileges !! </em>
<!-- SELECT END -->
Note that RETURN 1
is assumed by default,
hence when the clients IP address is listed in the
an OWNER variable (and the code block ends without a return)
the Hello! ...
message will not be deleted.
Notes
- Since SELECT greatly changes the structure of a page, documents
containing a SELECT keyword will not be ssi-cached.
- When entering the beginning and end SELECT keyphrases, you must use the
same set of delimiters.
- SELECT will not be done if:
NO_PROCESSING='YES', NO_INTERPRET_CODE='YES', or if
either a NO_CODE or a NO_SSP permission applies to this URL.
- SELECT blocks can not be nested. They may
contain other keyphrases.
- Older versions of SRE-Filter used
SELECT.RESULT=1 and
SELECT.RESULTS=0
instead of RETURN 1
and RETURN 0
(respectively).
This is still supported, but it is not recommended.
Return to table of contents
To improve performance, SRE-Filter will "cache" HTML documents that
have server side includes (SSI). This caching is of the document
after the SSIs have been performed.
In simple cases SRE-Filter can send this cached file, without having to repeat the actual
process of SSI lookups, etc. Needless to say, this can greatly
improve server performance.
For a complete description of SRE-Filter's SSI-caching algorithim,
and of the various options available for the CACHE keyphrase,
please read SSICACHE.HTM .
What follows is a very brief description of the options available
for the CACHE keyphrase.
- <!-- cache no -->
- Do not cache this document
- <!-- cache asis -->
- Use a cached version "as is"
- <!-- cache notrigger -->
- Do not check the trigger files; but do check the own
file.
- <!-- cache duration nnn -->
- Set the lifespan for this file's cache entry, where nnn is the number
of (possibly fractional) days.
- <!-- cache trigger file1 file2 .. -->
- Check the file-stamps for these fully
qualified files.
- <!-- cache trigger_type stamp -->
- Selects which field(s) of the trigger file-stamps
to check.
Return to table of contents
With only minor exceptions, the server side include syntax of the NCSA HTTPD server is
fully supported by SRE-FILTER.
These are invoked with a keyphrase of:
<!-- #cmd option="value" -->
Where cmd
can be: INCLUDE CONFIG FLASTMOD FSIZE ECHO EXEC
Details on NCSA HTTPD server side includes
Need more information on NCSA HTTPD server side includes?
Return to table of contents
Order of execution of KEYPHRASES
Server-side includes are processed in the following order:
- The requested document is read into memory.
- Headers and Footers, if specified, are included.
- Using the first "set of delimiters"
(by default, <!-- and -->) the document
(that now includes headers and footers)
is scanned for keyphrases.
- When a keyphrase
is encountered, the appropriate server side include is performed; or if
a SELECT keyphrase is encountered, a server side "exclude" may be conducted.
- After each keyphrase is processed, step 4 is repeated
(from the beginning of the file).
- This process continues until there are no more
keyphrases (using the first set of delimiters) to interpret.
- Step 3 is repeated, using the other sets of delimiters (i.e.; { and }).
Note that the keyphrases in the latter part of a
document are processed after
freshly included keyphrases.
While not the most efficient algorithim (long documents with many
server side includes will cause a lot of string comparisons),
it does enable recursive processing of all keyphrases
This recursive feature allows for some powerful document manipulation strictly through
the use of keyphrases. In particular, the INTERPRET keyphrase can examine variables
such as the "referer", the "client name", or the "OPTION list", and generate
inclusions that incorporate other keyphrases (which will be
processed on the next
cycle of keyphrase interpretation).
There are several caveats:
- SRE-Filter will check for potentially fatal recursive
includes,
and disallow them. If this should occur, a simple error comment is
added to the document that is sent to the client.
- If you use the AUTO_HEADER feature, you should not
place server side include keyphrases in the <HEAD> portion of your
HTML documents.
- In general, we do not recommend use of the
DO_SEND_PIECE (the
send pieces as they become available) SRE-Filter option.
If you do use it, note that:
- SSI-caching will be suppressed ,
- You will not be able to dynamically add cookies (say,
with an INTERPRET keyphrase)
- DO_SEND_PIECE is suppressed if:
- there is more then 1 set of
keyphrase delimiters, or
- the FIX_EXPIRE option is being used.
Modifying the request string
Specifying the home page (the default)
When the client sends an empty request string, a /
, or
"/?some+options"
,
SRE-FILTER assumes that the client desires the "home page" (the default document).
By tradition (but not necessarily) the default document is a file named
INDEX.HTM located
in the root of the data directory.
The default can be set using the DEFAULT or DEFAULT.HOST_NICKNAME
variable
(that is, DEFAULT may be host specific).
As mentioned at the top of this document, SRE-Filter's parameters are
set by modifying variables stored in INITFILT.80.
Return to table of contents
Specifying default documents for directories
Often, a request may arrive that specifies a directory, but does not specify a
file. For example, a request for COOLJUNK/JOKES/
does not specify a particular
file, but instead implies "give me the default document for the
COOLJUNK/JOKES subdirectory of the data directory". In these cases,
the AUTO_NAME variable is examined.
AUTO_NAME
should contain a space delimited list of filenames to use when
a request for a "directory" is recieved.
SRE-FILTER will attempt to find these files in this
"requested" directory --
starting with the first name in the AUTO_NAME list.
To assist in this search, a special name,
consisting of *.HTM (or *.HTML) means use the directory_name.htm file.
Lastly, an entry of !CREATE instructs SRE-FILTER to generate a directory
listing of files and subdirectories in the requested directory.
This listing is generated with SRE-Filter's !DIR
special action. By default, a <PRE> formatted table is
generated, containing (for each file):
- a descriptive icon
- a link to the file
- the file creation date
- the size of the file
- for HTML, TEXT, and .ZIP files... an automatically generated
description
If you are interested, it is fairly easy to
modify these display options
Example
AUTO_NAME=" *.HTM INDEX.HTM "
If the request string is for /INFO/MAINE/
,
and your data directory is D:\WWW
, then ...
*.HTM
is interpreted as: D:\WWW\INFO\MAINE\MAINE.HTM
INDEX.HTM
is interpreted as: D:\WWW\INFO\MAINE\INDEX.HTM
Notes
- AUTO_NAME has no effect on calls that do not
specify a directory name --that is,
the document specified in the DEFAULT
variable is used in response to an empty (or /) request string.
- AUTO_NAME, and other forms of "local redirection" can cause problems when the client's browser resolves
"partial URLS" -- see INITFILT.DOC for further discussion!
-
If you start an entry with a /, the file is assumed to be relative
to the data directory or to a "local or remote" virtual directory.
Otherwise, the file is assumed to be relative to the current
URL (you can include additional path information).
- If you are using .HTML as the default extension for HTML documents, use
*.HTML (instead of *.HTM)
For example: auto_name=" *.HTML INDEX.HTML PUBLIC_HTML/INDEX.HTML "
(note that PUBLIC_HTML/INDEX.HTM will look in the PUBLIC_HTML directory relative
to the current URL).
- If you want your default document to be a "SHTML" file, use *.SHTML
(or *.SHT, or *.HTML-SSI, etc.) instead of *.HTM.
- !CREATE should always be
the last item in AUTO_NAME (anything following it will never be reached).
- !SHOWDIR can be used as an alternative to !CREATE -- see
SHOWDIR.DOC
for details.
- For a full featured directory lister, you might want to examine the
GETAFILE add-on for SRE-Filter!
-
Request strings that do not end in a /, but have no ? and have no "." extension,
can be interpreted in several manners. The NOEXT_TYPE variable is
used to select how these request strings are interpreted.
NOEXT_TYPE
can take values of:
DIR
: Interpret as a directory; / is added and
AUTO_NAME is used.
For example, CHARITIES/HEALTH
is interpreted as a sloppy form of
CHARITIES/HEALTH/
(the "CHARITIES/HEALTH subdirectory of the data directory, or a
"local or remote" virtual directory).
REDIR
: Similar to DIR
, but the client is
redirected back to the modified url (that is, a remote redirection
is used).
HTM or HTML
: Interpret as an abbreviation for an
HTML file (with extensions of .HTM or .HTML respectively).
NONE
: Interpret as is.
-
other_string
: The other_string is added.
For example, if NOEXT_TYPE=.GIF
,
then .GIF
will be added to these "no extension" request strings.
Return to table of contents
Using ~ to specify the home directory
As a convenience, SRE-Filter will replace occurences of ~ characters
in requested URL's with a string. Since the ~ is often used to
point to a set of individual "home directories", this replacement string
is stored in the HOME_DIR variable.
To select the home directory , change the value of the
HOME_DIR (or HOME_DIR.HOST_NICKNAME) variable.
Example
If ...
HOME_DIR="BRANCH/STAFF/PERSONAL/"
and
The request string
is ~JOES/PAGE.HTM
,
.. then
SRE-FILTER will look for: BRANCH/STAFF/PERSONAL/JOES/PAGE.HTM
( under your data directory).
Notes
- This HOME_DIR "string replacement" does minimal syntax checking
(// are replaced with /). Thus,
one should be careful that the definition of HOME_DIR, and it's use in the
the links included in your HTML documents, is consistent.
Advanced Option: Specifying User Subdirectories
In many cases, you may wish clients to limit access to particular
subdirectories of your HOME_DIR
directory. For example,
suppose all "students" have space on the HOME_DIR
directory
of your web server; or HOME_DIR
may be on a LAN drive
accessible as a virtual directory from the web server. These
"student" directories may contain several subdirectories; one of which
is intended for WWW use, while the others are for personal
use.
The goal is to
give clients direct access to the "web" related directories
but not to the "personal" directories.
This goal can be achieved by including a $ in the HOME_DIR
parameter.
Specifically, the $ is replaced by the portion of the
request string between the ~ and the first / following this ~
For example: If:
-
HOME_DIR=USERS/$/WWW
- the request string is
/~GERALD/RESUME.HTM
Then SRE-Filter will use: /USERS/GERALD/WWW/RESUME.HTM
For futher details, see the discusssion of the HOME_DIR
parameter in INITFILT.DOC.
Using virtual directories
By default, SRE-Filter will match a requested URL to a file in the
data directory
;
or if the URL is a request for server side processing (such as an SRE-Filter
add-on, or a CGI-BIN script), to a file in the
working directory
or CGI-BIN directory
.
While a good security feature (files not in these directories are inaccessible),
this can be an inconvenience. To remedy this inconvenience, one can
define "virtual directories" using the VIRTUAL_FILE.
Basically, SRE-FILTER will compare the
starting portion of a URL to see if
it matches an entry in VIRTUAL_FILE. If it does, the
local or remote target directory listed
in the entry is used (instead of the data directory or working directory).
Thus, you can make available a wide, but controllable, set of "local"
directories (on or LAN accessible from) your server.
In addition,
"virtual directories" can point to "remote" directories on other http servers --
SRE-Filter will
attempt to retrieve the file from the remote server;
without using a redirection.
To clarify: to the client, remote virtual directories are indistinguishable
from "local" virtual directories.
In particular, HTML files with server
side includes can be remotely located -- and if the remote server makes
no attempt to process these server side includes, SRE-Filter will!
For details on the use of the virtual directories, see the description of the
VIRTUAL_FILE .
Note that entries in the VIRTUAL_FILE may be "host specific"
Return to table of contents
Using "aliases" when responding to requests
ALIASES are used in SRE-FILTER to redefine and redirect
request strings
Along with the ALIAS_FILE,
the CHECK_ALIAS parameter controls
whether and when ALIAS checking occurs.
CHECK_ALIAS should have one of the following values:
NO = Suppress ALIAS checking
YES = Enable ALIAS checking
- Local redirection:
To modify simple URLs's. For example:
- You may want to convert a request for a URL of
GETINFO
into: INFODIR/GETINFO.HTM
.
- Processing searchable indices.
The
DOSEARCH SRE-FILTER add-on, when combined with
an ALIAS, provides a simple means of implementing
text-based searchable indices.
To use SRE-FILTER's searchable index facility,
one should create an alias of the form:
INDXFILE.HTM?* DOSEARCH?FILE=FILE.NAM&TARGET=*
Where
INDXFILE.HTM
is the name of a
searchable index
(that is, an HTML document containing an <ISINDEX> element).
DOSEARCH
instructs SRE-FILTER to
"execute the DOSEARCH add-on."
FILE.NAM
is the name (relative to the data directory,
or in a "local" virtual directory) of the ASCII text file to be searched.
Note that the alias will not be activated on the first
request for INDXFILE.HTM -- only upon return (when a ? is appended to
the URL by the browser) will this alias match occur.
If you want to use some other text search program, you could set up
an alias of the form:
SEARCHIT.HTM?* SRCHREXX?*
- SEARCHIT.HTM is invoked at first (since the request string has no ?).
- The SRCHREXX procedure is called
after the client enters the search string (and the client appends a ? to
SEARCHIT.HTM). SRCHREXX should be a REXX procedure located in the
SRCHREXX.CMD (or SRCHREXX.80) file on your working directory; and it
might call a powerful search engine.
- Remote redirection: Redirecting requests for moved documents
There are 4 ways of using an alias to indicate that a document has been moved to
a new server:
target http://new.site.org/newname
- If the request string matches target, "temporary" (HTTP status code 302)
redirection to the URL. A full URL must be specified (starting with http://).
-
target !TEMP http://new.site.org/newname
- Same as above, but you can use short-hand's URLS (i.e.; without the http://).
If you do not include an ip address, redirection will be back to the server.
-
target !MOVED http://new.site.org/newname
- Same as above, but the redirection is permanent (HTTP status code 301).
-
target !NOTIFY http://new.site.org/newname
- A "message has been moved" document will be returned to the
client, which will contain a link to it's new location. Techincally
speaking, this is not "redirection". Rather, it's a "notification of redirection",
with the intention that the client will change the appropriate links (or bookmarks).
Citation: The code for this is courtesy of Don Meyer!
Examples:
PROJ/P48.HTM http://www.prez.edu/truman.htm
PROJ/LINCOLN/* !MOVED civ.war.org/p1/alinc.htm
Notes:If you do not use !TEMP or !MOVED,
you must specify a full URL-- do not forget the http://.
- Redirecting requests for CGI-BIN scripts (somewhat obsolete,
use of "url substrings" is now recommended).
If you want to run a CGI-BIN script that is not in your CGI_BIN_DIR
directory, you can use the ALIAS file to provide path information. In this
case, the alias should consist of the CGI-BIN script name (without any
slashes or other path information), followed by the drive and directory
where it can be found.
For example:
- If ..
- A URL of
CGI-BIN/MAKEMAP/?NEB+IOWA
is recieved
- The ALIAS file contains a
MAKEMAP D:\EXES\GIS
entry
- MAKEMAP.EXE is a CGI-BIN script located in D:\EXES\GIS
- then...
- D:\EXES\GIS\MAKEMAP.EXE will be invoked, with NEB+IOWA placed
into standard input (along with all the other CGI-BIN variables stored in
the environment).
Note that if this MAKEMAP D:\EXES\GIS
entry did not exist,
SRE-FILTER would look for a MAKEMAP program (such as MAKEMAP.CMD) in your CGI_BIN_DIR
directory.
Notes
- Entries in the ALIAS_FILE may be "host specific"
- The use of aliases as a means of identifying the location of a
CGI-Bin script is "not spec", so should be used with caution.
- "Local redirection" using aliases can cause problems when the client's browser resolves
"partial URLS" -- see INITFILT.DOC for further discussion!
- You can use wildcard matches and wildcard
matches with substitution
in your aliases (note the LINCOLN example above). This
is useful if you want to redirect all request for files that used to be in a subdirectory
to some new location.
-
ALIASES are processed before the AUTO-NAME replacement is attempted. Keep
this in mind when considering how to handle requests that arrive with
no extension, no ?, and that do not end with a /.
Return to table of contents
What to do if no document can be found
Sometimes, despite the use of "aliases" and "AUTO_NAME", the requested
"action" (such as an HTML document, or a Server Side program) can not be found.
In those cases, a 404 Not found
response
is returned to the client, along with a short description. You can put
a customized message in this short description. In particular, you
can put a link to your "home page".
The NOT_FOUND_URL variable
contains this customized message. By default, it's value is:
<a href="/"> Visit the HOME_NAME home page? </a>
Note that HOME_NAME
will be replaced by the current (possibly host
specific) value of the HOME_NAME variable.
Thus, the befuddled client merely needs to click on this link to get some kind
of access.
Notes:
- For greater customizaton, you can set NOT_FOUND_URL to be
a fully qualified file name. This file will be called whenever a file
can not be found. Typically, this would be an HTML document (say,
D:\WWW\NOTFOUND.HTM).
- HOME_NAME
should contain a
short description of your domain; say:
BIG/SERVICE: Your Friendly Government Agency!
.
Or, you can set HOME_NAME
=" "
to send a generic message!
- Note that HOME_NAME and NOT_FOUND_URL can be HOST specific.
- For further discussion of HOME_NAME and NOT_FOUND_URL, see
INITFILT.DOC.
Return to table of contents
Using imagemaps
SRE-FILTER provides a simple means of responding to
image maps, using
NCSA style "MAP" descriptor files. The key is to include a
MAPIMAGE/ substring in the the "resource location" of a
URL that points to a .MAP file.
More specifically, when a MAPIMAGE/ substring is encountered in the action
portion of the request string, SRE-FILTER will remove MAPIMAGE/, and assume the
remaining portion of the action refers to a MAP file.
For example, if the request string is:
MAPIMAGE/PROJECTS/BRANCH1.MAP?55,123
then the "mappable image" handler would look for
PROJECTS\BRANCH1.MAP
(under the data directory,
or a "local" virtual directory), and use
the instructions therein (in conjunction with the pixel location 55,123)
to "redirect" the client.
Type of regions recognized.
There are four types of regions recognized by SRE-FILTER:
-
Circles
-
Rectangles
-
Polygons
-
Points
- and you should always specify a DEFAULT url
The selected pixel will be assigned to the URL associated
with the first Circle
, Rectangle
,
Polygon
, or 'exactly-hit' Point
it matches.
If there is no such match, and
there are Points
specified in the MAP file, then the
URL associated with the closest Point
is used.
However, if the distance to this closest Point
is greater
then the value of the MAX_POINTDIST variable,
or if there are no Points
specified in
the MAP file, the default URL is used.
Notes:
- The MAP file must be in your data directory
, or a "local" virtual directory
.
(i.e.; if your data directory is
E:\WWW, then the above example refers to E:\WWW\PROJECTS\BRANCH1.MAP)
- There are several handy "map" making tools available, such as MAPEDIT.
- The SAMPMAP.HTM file that comes with SRE-FILTER (which uses SAMPMAP.MAP and SAMPMAP.GIF) provides a simple example.
- Your MAP file should, but need not, contain fullly specified URLS. The http:// will be added
if missing; and if there is no IP address, your server's address (and port) are added.
- If the selected URL (the URL corresponding to the selected point) is a
"virtual URL" (contains no IP address, and does not start with a /), then
the invoking URL (minus the MAPIMAGE/) is used.
Thus,
- if the selected point is associated with
ANIMALS/TIGER.HTM,
- the .MAP file was /ZOO/GUIDE/CAGES.MAP,
- THEN ...
- the selected URL will be /ZOO/GUIDE/ANIMALS/TIGER.HTM.
Please remember that the MAPIMAGE/ "indicator string"
does not refer to the MAPIMAGE/ directory!
Return to table of contents
Server Side Processing using SRE-Filter add-ons
SRE-FILTER provides a simple means of creating your own,
custom written, SRE-Filter add-ons.
The basic idea
is to write an "external" REXX procedure which will do the processing, or which calls
some other executable program (such as a database manager), and then tell SRE-Filter to
call this procedure.
The following steps outline how to do this:
- Create an HTML document that returns an
action
that invokes a Server
Side Processing request. For example, you might include a FORM
element with an ACTION attribute of "/FAST1".
- Create a file (that contains your REXX procedure), with the name
xxx.CMD (or xxx.80) , where
xxx is the action name. Note that the
xxx.CMD file is relative to the working directory (or a
"local" virtual directory).
For example, if the action name is /PROGS/FAST2, and \GOSERVE is your working directory,
SRE-FILTER will look for /GOSERVE/PROGS/FAST2.CMD.
- This REXX procedure should process the request (using information
passed to it by SRE-Filter), and it
may call other programs (not necessarily REXX programs).
- xxx.CMD should issue GoServe completion
codes (such as VAR, FILE, and STRING).
The xxx.CMD should return a
simple status message (say, for use by the Post-Filter).
The xxx.CMD procedure will be called with following arguments:
- ddir
- The data directory (typically, x:\WWW)
- TEMPFILE
- A temporary, "transaction specific" file (i.e.; /$341.80)
- Action
- The Action portion of the request string
Example (assuming the GET HTTP method
was used by the client)
- If the request string is:
/sports/getscore?city=boston&date=July+5+1994
-
then the Action is
sports/getscore
- list
-
- If verb=GET: the partially cleaned up portion of the request
string from after the ?
( + signs, tabs and linefeeds are converted to spaces, and
URL decoding is performed).
In the above example, list would be city=boston&date=July 5 1995
- If verb=POST: the body of the request -- without + conversions
or URL decoding.
- verb
- Either GET or POST
- Request string
- The original request string (without cleanup or encoding).
This can be useful if & (and other special characters) may
be text returned by GET method client requests
- user
- The numeric IP address of the client
- servdir
- The "base directory", where GoServe and SRE-FILTER are located.
- workdir
- The fully-pathed name of a "temporary, working" directory
that the external procedure may wish to use
(set in the TEMPFILE_DIR variable).
- privset
- The list of privileges granted to this client.
- env_id
- A substring used when specifying semaphores and queues
- transaction
- The transaction number
- verbose
- The verbose instruction (1 signifies "say intermediate results").
- servername
- The IP name of the "host" this request is addressed to. This is derived
from a HOST: argument, or from the numeric ip address.
- Host_nickname
- The SRE-Filter nickname for the "host".
- Home_directory
- The "home directory" (used in ~ replacment)
Notes
- How does SRE-FILTER recognize a Server Side Processing Request?
- If VERB=GET
... SRE-FILTER looks for
a ? character in the request string, and also checks that the
request string is not for a text/html file.
- If VERB= POST
... SRE-FILTER assumes it is a Server Side Processing Request.
- STATUS.CMD, and STATUS.HTM, contain an example of how to
request Server Side Processing using a REXX
procedure.
- If a syntax error occurs, SRE-FILTER will trap it and return
a (probably uninformative) error message to the client.
- To call external, non-REXX programs, use the
address cmd
REXX command.
- If you write HTML code to TEMPFILE (for return to the client), you
should return from your external REXX procedure using:
'FILE ERASE TYPE text/html NAME ' TEMPFILE
return ' a message here '
- When using an HTML FORM to invoke a
Server Side Processing Request, the "action" should
contain a leading / character
(this avoids incorrect path assignment by the browser).
- If the NO_PROCESSING variable equals YES,
then server side processing will not be permitted.
Return to table of contents
Support for CGI-BIN scripts.
SRE-FILTER supports CGI-BIN scripts (using procedures adapted from
Don Meyer's GoHTTP package). To run CGI-BIN scripts, you'll need to:
- Make sure that the CGI_BIN_DIR points to an existing
directory (i.e.; /GOSERVE/CGI_BIN).
- Copy the CGI-BIN script (such as a REXX file, a binary .EXE file, etc.)
to the
CGI_BIN_DIR directory.
- Invoke it using a standard CGI-BIN URL. For example:
href=http://foo.bar.net/cgi-bin/test-cgi/morepath/?a+message
.
- Requests for CGI-BIN imagemaps (such as
/CGI-BIN/IMAGEMAP/MAPFILE.MAP
) are converted
into SRE-FILTER IMAGEMAP calls.
- SRE-FILTER comes with a few sample CGI-BIN scripts (written in REXX).
The TEST-CGI.CMD
file (which is copied to your CGI_BIN_DIR) will display the values of the
CGI-BIN variables (invoke it using /CGI-BIN/TEST-CGI?).
Need more information on CGI-BIN ?
By default, CGI-BIN scripts are assumed to be in the CGI_BIN_DIRECTORY
(say, \GOSERVE\CGI-BIN). Obviously, this can become inconvenient
once you acquire a less-than-small set of scripts. The obvious
solution is to place the script files in subdirectories.
Unfortunately, there does not seem to be a clearly specified method
of doing this. With this in mind, SRE-Filter offers two means
of specifying subdirectories containing your CGI-BIN scripts:
- Using "aliases".
This does not require changes to the standard syntax of
CGI-BIN requests; i.e.; CGI-BIN/ASCRIPT/PATHINFO/?args ).
The disadvantage is that a seperate alias is need for each script --
even for scripts in the same subdirectory.
- Using the portion of the request string before the
CGI-BIN/
The notion is to include subdirectory information before
the CGI-BIN/
(the "this is a CGI-BIN script" indicator). SRE-Filter
will interpret this starting portion as a subdirectory of the CGI_BIN_DIR,
or as a virtual directory (in both cases,the usual HTACCESS controls may apply).
This permits a powerful division of scripts into directories. The disadvantage
is that it doesn't seem to be "spec" (hence may be cumbersome to port).
Requests for CGI-BIN scripts are often followed by /PATHINFO/.
This is typically used by the script (it does
not point to the script).
Example: KIDSTORE/INVENTORY/CGI-BIN/TOYCT?toddler
This invokes the TOYCT program (with an argument of toddler
),
which is located
in (perhaps) \GOSERVE\CGI-BIN\KIDSTORE\INVENTORY.
Notes on creating CGI-BIN scripts
- When writing CGI-BIN scripts, keep in mind that a number of
variables are available in the enviroment.
- You can output results with SAY statments.
- Your first SAY statements should declare the MIME type. For example:
Say "Content-type: text/html"
Say
Using PERL scripts with SRE-Filter
In order to take advantage of a broad spectrum of CGI-BIN scripts,
SRE-Filter can use "non-REXX" processors to interpert CGI-BIN scripts.
As long as you have the appropriate interepreter installed on your
server, it's quite easy to do this. All that you need to do is
tell SRE-Filter (using the INTERPRET_TYPES parameter) which
interpeter to associate with different file extensions -- see
INITFILT.DOC for a details on how to change the INTERPRET_TYPES
parameter.
Of particular interest is the use of one of the OS/2 PERL interpreters;
since there are a slew of PERL scripts out there. In fact, it's not that
hard to obtain a PERL interpreter --
see PERL.DOC for details
on one we've had some success with.
Return to table of contents
- SRE-Filter supports a limited form of multi-hosting. Multiple hosting can occur in
two different manners:
- When multiple numeric IP addresses are handled by a
single computer
- When multiple aliases exist for a single numeric IP address; and
the HOST: request header is provided by the client's browser.
-
SRE-FILTER offers a number of logon controls.
The basic control is set
by the value of the CHECKLOG variable, as modified by the values
of the INHOUSEIPS.n, UNALLOWEDIPS.n, and
OWNER variables.
- A set of PUBLIC_URLS
can be made available to the public without requiring logon.
- User specific privileges are used to permit
(or deny) access rights to your server's resources.
- request-string-specific, and
directory-specific, access controls permit more refined
site management options.
To use SRE-Filter in a multi-host environment, you must set the HOSTS.
stem variables; and you should include a host nickname
when defining a number of SRE-Filter parameters.
The HOSTS. stem variable (set in INITFILT.80) defines the hosts (either IP addresses
or aliases) that your server will work with. Each HOST. variable should contain
the following information (in a comma delimited list):
HOSTS.n ='ip_address, host_nickname,default_dir'
Where:
ip_address
is a IP address (integer or numeric)
host_nickname
is the "nickname" you will use when
referring to this host. The host_nickname
must not
be a number, it must contain at least one non-digit character. Thus, a
host nickname of 1234
is invalid,
but 1234X
is okay.
default_dir
is the default directory for this host (it
is used instead of the GoServe default data directory).
If your server recieves request from a host which does not have a matching
HOSTS. entry, it will be treated as "generic" request; that is, the standard
(single host style) default directory, etc. will be used with such requests.
Thus, if all requests, regardless of intended host,
have identical access to your server's resources (files and programs)
you can ignore this entire section!
Given that you do want to have different resources available to
different hosts, almost all of the SRE-Filter variables and parameters can be specified
on a "host specific" basis
- To specify "host specific" parameters in the .IN, .CTL, and .CNT files the
host nickname, followed by //, is used.
For example, for a virtual directory entry that maps TIGERS/ to
D:\ANIMALS\TIGERS, but only for requests to ZOO.OURISP.NET; you might specify:
ZOOSITE// TIGERS/ D:\ANIMALS\TIGERS
where ZOOSITE is the host nickname for ZOO.OURISP.NET, and a space separates the
ZOOSITE// from TIGERS/.
- For parameter names (defined in INITFILT.80), host-specific results are
defined by appending a .HOST_NICKNAME to the variable name. For
example,
CHECKLOG.ZOOSITE='NO'
refers to this "ZOOSITE" host.
- A few of SRE-Filter's parameters are not host specific; such
as the DISPLAY_ENV parameter.
Notes
- The host specific default directories are defined in the
HOSTS. stem variables.
- Requests to IP addresses not represented by a HOSTS. entry are treated as "generic" requests;
that is, the standard (single host) variables apply.
- In general, if a SRE-Filter variable/parameter does not contain
host nickname information, then it applies to ALL hosts. In other words, if
a host specific value of a parameter does not exist, the "generic" value is used.
- INITFILT.DOC discusses in greater detail which SRE-Filter parameters
may be host specific.
- Be careful when using shorthand IP names (say, in a mixed
Internet/Intranet environment).
PUBLIC_URLS
There may be cases where you generally do not want to allow access to your site, except
for a set of publicly available URLS (such as a "who we are" document).
Although one could use selective access controls,
using the PUBLIC_URLS. stem variable provides a simple and direct
alternative.
The PUBLIC_URLS. stem variable should list URL's
that are "open to the public" -- that can be accessed by clients
who have no logon rights and no access privileges.
Basically, SRE-FILTER compares the request string (using
wildcard matching with substitution) against
the entries in the PUBLIC_URLS. stem variable.
All requests that match a PUBLIC_URLS stem variable:
- will be examined for ALIASES and for virtual directory matches
- will be checked for an extension, and
will be examined for AUTO_NAME match (if needed).
- server side includes, and server side processing, will be performed
(provided the NO_INCLUDE and NO_PROCESSING variables are not in force).
- Caching will not be suppressed.
- The PUT and DELETE methods will not be permitted
- the clients privileges are set to
PUBLICFILES PUBLIC
,
plus the privileges in the PUBLIC_PRIVS SRE-Filter parameter.
PUBLIC_URLS can also specify literal public_urls. When a
requested
URL matches one of these literal public_urls; file transfer
is expedited by:
- Not performing aliasing
- Not using virtual directories and AUTO_NAME
- Not attempting server side includes
- Not attempting AUTO-HEADER.
More importantly, the SREFQUIK variant of
SRE-Filter is written to
quickly transfer these literal public_urls-- cutting
response time by as much as 50% under moderate to heavy load!
Notes:
-
Caution: If a client
has logon privileges, and she submits a request that matches a PUBLIC_URLS entry, it
will be treated as if the request came from a "complete stranger" (for example,
PUBLIC privileges will be given regardless of INHOUSEIPS status).
- In a multi-host environment, the PUBLIC_URLS must be host specific (that
is, "non-host specific" values of PUBLIC_URLS are not
not used as defaults).
- For a more detailed description of how to use PUBLIC_URLS, and
details on how to specify literal public_urls-- see
INITFILT.DOC
Logon Controls
Setting LOGON requirements with the CHECKLOG variable
CHECKLOG should have one of the following values:
- NO
- No logon required; unencumbered entry for all clients.
- YES
- Logon upon invocation of the default page (i.e.; an empty request string).
- ALWAYS
- Logon required for all requests.
- INHOUSE
- Entry allowed only to clients with INHOUSE or SUPERUSER
privileges.
Allowing unencumbered access to IN-HOUSE users
The INHOUSEIPS. stem variable can be used to specify the numeric IP
addresses of clients who are to be given "IN-HOUSE" status. IN-HOUSE client
do not have to enter logon information, and they are automatically granted
the privileges stored in the INHOUSE_PRIVS variable.
Notes
- INHOUESIPS must be host-specific;
INHOUSEIPS.1.ZOO='151.121.65.143' (see INITFILT.DOC for details).
-
The * character can be used as a "wildcard" in the INHOUSEIPS. stem variables.
- Each INHOUSEIPS. value can include a client specific list of privileges (place
it after the IP address).
Owners have SUPERUSER status
You can give SUPERUSER
privileges to a set of numeric IP addresses by changing
the value of the OWNERS variable.
Notes:
Wildcards are not allowed in the OWNERS variable
OWNERS are given INHOUSE_PRIVS privileges, as well as SUPERUSER privileges.
The OWNERS variable must be host-specific (see INITFILT.DOC
for details).
Logon for non IN-HOUSE users.
If a logon is required, an authorization string (containing
a name and password) is obtained from the
client. SRE-FILTER then examines the USER_FILE
for a match. If a match is found, the request is honored (abstracting
from URL or directory specific access controls). Otherwise
the client is asked to re-enter her name and password. Note that entries
in the USER_FILE may be "host specific".
Be aware that ...
- The HTTP "basic access authentication scheme" is used to
encode the username and password. This is a fairly low security method.
Furthermore, the INHOUSE setting of CHECKLOG can be circumvented by
clever "spoofers". In other words, SRE-FILTER is not designed for high-security
environments!
- Once asked for an authorization, most browsers will include
an "authorization field" in subsequent requests to the same site. Thus,
even if
CHECKLOG=ALWAYS
, the client will only need to enter his
username and password once (that is, she won't need to reenter it each
time a different document is requested).
Keeping out known pests
There may be cases where one needs to deny access to
particular client(s). This can be accomplished by
recording the numeric IP addresses of these "unwanted clients" in the
UNALLOWEDIPS.n stem variables (wildcards are permitted).
Note that the OWNERS and INHOUSEIPS.n
stem variables are checked first. If the
client's numeric IP address appears in either of these lists,
UNALLOWEDIPS.n is not checked. Thus, by setting
UNALLOWEDIPS.1="*.*.*.*"
, you can deny entry to everyone
except OWNERS and IN-HOUSE users.
Also note that UNALLOWEDIPS. entries must
be "host-specific" (see INITFILT.DOC for details).
Detecting fake IP addresses
For additional security, you can set the DNS_CHECK variable (to YES).
When set to YES, SRE-FILTER will lookup the client's IP name; and if
it does not exist (there is no DNS entry), logon will be denied. This
provdes some security against "spoofers", but it also slow's down
response time, and may keep out legitimate users using dynamic (and
possibly unnamed) numeric IP addresses.
The LOGON_FAIL_FILE
If the client does not have "logon rights", SRE-Filter will use the value
of the LOGON_LIMITand the LOGON_FAIL_FILE to determine
the response.
- LOGON_LIMIT is used to limit the number of attempts-per-minute.
- If LOGON_LIMIT is exceeded, or the username/password is incorrect,
you can then send the
LOGON_FAIL_FILE as a "response" (rather then continuing to re-request
the username and password).
For further details, see
the description of LOGON_LIMIT and LOGON_FAIL_FILE in INITFILT.DOC.
Assigning privileges
In several circumstances, SRE-FILTER will check the "client privileges"
before transferring information. In particular,
file transfer when URL-specific access controls
are in place (i.e.; when ALLOW_ACCESS='NO'
) requires that the
client have appropriate privileges.
In a sense, privileges offer a
convenient shorthand for identifying sets of users.
Privileges are set automatically for:
IN-HOUSE clients are granted privileges stored in their INHOUSEIPS. variable,
OWNERS are granted SUPERUSER privileges.
In addition, IN-HOUSE clients and OWNERS will be granted the
privileges that are listed in the INHOUSE_PRIVS "space delimited
list" variable. It is recommended
that INHOUSE_PRIVS always include the INHOUSE privilege.
For everyone else:
If a logon is required, the privileges are read from the
USER_FILE.
Last of all ..
Privileges listed in the the PUBLIC_PRIVS "spaced
delimited list" variable are given
to everyone.
In addition to the above "static" privileges, clients can be assigned
"dynamic" privileges. These dynamic privileges are typically
set by prior actions (say, filling out a registration form, or
requesting an introductory file), and have a short life expectancy (measured
in minutes). For further discussion of these "dynamic" privileges,
see ADDPRIVS.DOC, and the discussion of the CHECK_ADD_PRIVS
and ADD_PRIVS_PREFIX variables in INITFILT.DOC.
Accesss control on a URL-specific basis.
There may be cases where you want clients to have unencumbered
access to some, but not to all, the resources of your server.
The ACCESS_FILE,
and the ALLOW_ACCESS variable, can be
used to accomplish this "URL-specific" access control.
ALLOW_ACCESS can take the following values:
- YES
- No limits -- all clients (with logon rights)
are automatically given access rights to the URL.
- INHOUSE
- IN-HOUSE users (and SUPERUSERS) are given automatic access rights,
all others must have appropriate privileges.
- NO
- No one (except SUPERUSERS) is given automatic access rights,
all others must have appropriate privileges.
When ALLOW_ACCESS is binding (when privilege information
is checked),
SRE-FILTER will use the URL-specific "resource privileges list" in
the ACCESS_FILE to dictate whether or not
to honor each request.
the
In addition to general access rights (do you have any rights to the URL),
the ACCESS_FILE contains a "URL-specific"
permissions list. This permissions list includes
information on:
- suppression of server side
includes and server side processing
- PUT and DELETE permissions
- CACHE enabling
- suppression of aliasing, directory-specific access controls, virtual directory lookup, and post-filtering
- the URL-specific REALM.
- the URL-specific access failure file.
For details on how to set these permissions, see the discussion of
the ACCESS_FILE.
Note: permissions are examined even when ALLOW_ACCESS=YES
Notes on URL-Specific access control
First, a clarification of the term URL-specific:
A better term for URL-specific might be Selector-specific.
The Selector is the request string, minus anything following a ?.
Thus, if someone hits a link (coded into an HTML document) of:
http://foo.bar.net/mydir/myfile.html
the selector is: mydir/myfile.html
Two types of resource privileges
There are two types of resource privileges :
- ONE_OF (the default type).
- The client must have "one of" the ONE_OF privileges.
- MUST_HAVE (start with the & character)
- The client "must have" all the MUST_HAVE privileges.
Note: if only one privilege is specified, these two types are equivalent.
Other notes
- The client's privileges are compared against the
the URL-specific resource privileges list, and the
the REALM-specific resource privileges list (every URL identified
as belonging to a given realm will have the same list of REALM-specific resource privileges).
- Entries in the ACCESS_FILE can be "host specific".
- The default ACCESS_FILE is ALL_FILE.CTL.
- Files requested by server side includes are not subject to
access controls.
- If the ACCESS_FILE does not exist,
then access is disallowed to clients for whom ALLOW_ACCESS is binding.
The idea is that if there is no matching entry (in the ACCESS_FILE)
for a URL, then the resources
associated with the URL should not be accessible.
(... and if the ACCESS_FILE is unavailable, then there can't be a match).
- Wildcard matching is supported.
Note that global values of NO_INCLUDE=YES and NO_PROCESSING=YES take precedence
over the "URL specific" SSI and SSP permissions!
- Warning: use of the CACHE permission
can inadvertently subvert access control!
- You might want to include a global wildcard match.
For example:
* NO
-- if not explicitily mentioned, do NOT allow access
* *
-- if not explicitily mentioned, allow access
- If the client does not have access to the "URL", SRE-Filter will use
the value of ACCESS_FAIL_FILE to dicate the response. If
ACCESS_FAIL_FILE=0, a username/password will be re-requested. Otherwise,
the ACCESS_FAIL_FILE, or a "URL-specific" access failure file, will be
returned. For details, see the discusion of ACCESS_FAIL_FILE in
INITFILT.DOC.
Return to table of contents
Notes on URL-specific permissions
Suppressing server-side actions
You can suppress server-side-includes, and server-side-processing on a "URL-specific"
basis by including NO_SSI and NO_SSP permissions (respectively). You can also
suppress "in-document" server-side processing (the SELECT and INTERPRET CODE
keyphrases) by including a NO_CODE permission (note that NO_SSP implies NO_CODE).
Permitting the PUT and DELETE methods
SRE-Filter understands the PUT and DELETE
HTTP methods. The PUT method
is used to upload a file to your server, and save it using the URL
specified in the request string. The DELETE method is used to delete
a file, as specified by the URL specified in the request string.
For
security reasons, PUT and DELETE requests will only be honored if
the appropriate permssion (PUT or DELETE
respectively) appears in the permissions list .
Furthermore, when using the PUT_FILE or
GET_URL facilities to upload to a non-upload_directory subdirectory (that is,
to a virtual directory), the PUT permission must apply (to the "relative file
name" that matched this virtual directory).
Suppressing examination of HTACCESS files
To suppress the use of HTACCESS files for selected URLs, include a
NO_HTACCESS permssion. Note that this will not effect the SHOWDIR
dynamic directory list processor.
Suppressing virtual directory, post-filter, and aliasing
The NO_VIRTUAL, NO_POSTFILTER, and NO_ALIAS permissions will suppress
virtual directory lookup, post-filtering and file recording, and alias lookup
(respectively) on a URL-specific basis.
Allowing a file to be cached
Whenever there is a possiblity that access to a resource will be
denied to a client, SRE-FILTER will disable caching of the URL.
In particular, if CHECKLOG is not equal to "NO", or
if ALLOW_ACCESS is not equal to "YES", then caching
will be suppressed.
While an important security feature, there may be cases where
you are willing to sacrifice some access control in order to speed up
request processing. To achieve this, you can enable caching (on a
URL specific basis) by including CACHE in the
permission list.
Note that for caching to occur, the GoServe caching option must
be turned on!
Specifying the realm of the URL
When ALLOW_ACCESS is binding, and the client does not have
a matching privilege, SRE-FILTER will query the client for a new
username/password. When querying, the url-specific realm
is displayed if available. If there is no url-specific realm, the
THE_REALM realm is displayed.
Directory-specific access control, using HTACCESS files.
To provide compatability with HTTPD style servers (such as Don Meyer's
GOHTTP), SRE-Filter now supports the
HTACCESS method of access control.
This support uses code graciously loaned
to us by Don Meyer, suitably modifed for SRE-Filter.
Briefly, the HTACCESS method utilizes special HTACCESS
files that are placed
in your various directories (usually with the name HTACCESS.
,
or .HTACCESS
). These files (there may one in each of several
directories) contain entries pointing to password files, user-group files,
and other parameters that
are used to ascertain who shall be given access to the
files in the directory (and it's child directories).
HTACCESS control will be checked for all requests.
Note that the presumed location of
the HTACCESS file depends on the type of request:
- Request for documents (including PUT and DELETE method requests) == In the directory of the document
- File uploads == In the target directory of the upload (typically the UPLOAD_DIR directory)
- CGI-BIN requests == In the CGI-BIN directory (or appropriate subdirectory)
- SRE-Filter's built-in and included facilties == In the GoServe directory
- Other server side processing requests == In the directory containing the requested program.
In all these cases, the "parent" directories are also checked for HTACCESS files.
Notes on the use of the HTACCESS method
- Both methods of access control CAN be active: the
"native" SRE-Filter "URL-specific" access is checked first, and then the
"HTACCESS" method of "directory specific" access is checked.
- Since just about all the options provided by the "HTACCESS" method can
be provided by the "native" SRE-Filter methods:
on speed of throughput grounds
we recommend using the "native" SRE-Filter
methods (that is, modifying the ACCESS_FILE and ALIAS_FILE) whenever possible.
- For details on enabling SRE-Filter's support of HTACCESS controls,
see the description of the DO_HTACCESS and
HTACCESS_FILE variables in INITFILT.DOC.
- HTACCESS lookups are suppresed when the request matches a PUBLIC_URLS
(that is, HTACCESS controls, redirection, etc. will not be attempted).
- The HTACCESS files may also contain:
- URL "redirection" information,
- directory-specific default index information,
- Dynamic directory list processor parameters
There are several means of tracking the number of requests recieved
by your server.
For HTML documents, you can use the REPLACE HITS
keyphrase. In particular, if you want to record requests for all your HTML documents,
you can include a REPLACE HITS
keyphrase in your Header. variable.
However, a more complete (and automatic) means of noting requests
is to set the RECORD_OPTION
variable.
RECORD_OPTION can take the following values:
- NO
- Do not record requests.
- YES
- Record requests, but strip out the argument list first
(for example; remove
?hi+there
in
ANIMALS/MONKEY.HTM?hi+there
)
- YES_ALL
- Record requests, do not remove an argument list.
Caution: Use of YES_ALL can lead to a very large
RECORD_ALL_FILE
- FILE
- Record requests by fully qualified file name. In contrast, when YES or YES_ALL
are specified, requests are recorded by "request string" (by URL).
Caution: Use of FILE can lead to a very large
RECORD_ALL_FILE -- careful use of wildcard entries is recommended.
Record refers to updating a count of the number
of times a resource has been requested.
It does not mean keeping a record of each hit! If you need
such detailed accounting, you can modify the AUDIT settings of GoServe (GoServe writes
request information to the GOAUDIT.80 file), or you can add a custom-written
procedure using the post-filter option
(POSTRCRD.80 is an example of such a procedure).
Implementation details
To speed throughput, SRE-Filter caches the RECORD_ALL_FILE in memory,
with a single thread responsible for updating it (the POSTFCHK thread).
This raises several issues:
- The cache is written to disk on a regular basis (about
once every five minutes). Thus, it is possible for the file
version to be somewhat out of date; and it is possible to loose
entries (say, if the server crashes).
- If you "hand edit" the RECORD_ALL_FILE (say, to add
wildcard entries), SRE-Filter will
read it into the cache, overwriting any changes that have been recently
made. That is, any requests recorded between the time you saved the
"hand edited" file, and the last time SRE-Filter wrote a version
of it's cached list to disk, will be lost.
- If the cache grows large (over 1000 entries), SRE-Filter will
start over -- and save the old RECORD_ALL_FILE (you won't loose
information, but it will be spread over at a few files).
There is one exception: SRE-Filter will retain "wild card" entries
(but will reset their count to 0).
Given the above: the RECORD_ALL_FILE should be treated as
an approximate (albeit probably very accurate) count of requests.
To avoid loosing a few minutes of entries that will occur
when you shut down GoServe, you can issue a !WRITE_CACHE request
just beforehand
To reduce the number of false hits from clients re-requesting
a document after a short absence (often caused by the
use of a browser's "backup" key), a list of current hits
can be maintained. If a request matches a request in this list of
current hits
(where the request string and the client's IP address are both used),
the "count of hits" will not be augmented. Specifically,
the COUNTER_FILE and the RECORD_ALL_FILE will not be augmented.
In addition to "re-requests", you may also wish to not record
requests from OWNERS (such as the webmaster) -- since these are likely
to be due to site maintenance activity, and not due to interest in the content
of the requested files.
INITFILT.DOC contains details on both of these options: see the
descriptions of the
HIT_CACHE_LEN, HIT_CACHE_DURATION,
and HIT_OWNER_SUPPRESS variables.
Notes
- Wildcard matching of entries is supported,
both by "URL" and by "FILE".
- By default, results are written to RECRDALL.CNT -- this can
be modified by changing the RECORD_ALL_FILE
variable.
- Entries in the RECORD_ALL_FILE may be "host specific". However,
when FILE is specified, host information is not used.
-
For YES and YES_ALL, each entry in the RECORD_ALL_FILE contains
the request string (minus the
argument list if RECORD_OPTION=YES), the number of
"honored" requests, and the date of the most recent request.
For FILE, each entry contains the fully qualified file name, the number of times
the file was requested, and the date of the most recent request. Note
that when FILE is used, information after the ? is ignored (there is
no FILE_ALL option!).
- Only "honored" requests are recorded
-- requests for actions that are not honored (when
ALLOW_ACCESS is binding) are not recorded.
- If an entry matching the requested action is not found
in RECORD_ALL_FILE, a new entry will be created!
- ... however, a wildcard match is always attempted.
The use of "wildcard matching" is recommended if many
temporary files are likely to be requested. For example,
one should include a "wildcard" for
the "temporary" directory in your RECORD_ALL_FILE
- The size of the RECORD_ALL_FILE cache can be increased or
decreased by changing the RECORD_CACHE_LINES variable.
Or, you can suppress this caching by setting RECORD_CACHE_LINES=0.
See INITFILT.DOC for details.
-
The differences between the RECORD_ALL_FILE method, and placing a
REPLACE HITS (or REPLACE HITS_FILE) keyphrase in all documents, are:
- Nothing is written to the requested file
(the client is not given info on # of hits)
- The RECORD_ALL_FILE is updated,
not the COUNTER_FILE.
- All requests are tracked: including transfer of HTML documents and.GIF files,
and Server Side Processing requests.
Thus, if a REPLACE HITS
keyphrase is included in a document,
and RECORD_OPTION is enabled ,
a "count of requests" will be updated in the COUNTER_FILE and in
the RECORD_ALL_FILE.
Special commands, and directives, recognized by SRE-FILTER
SRE-FILTER offers a set of special commands,
and special directives for performing
TCP/IP actions, computing statistics on the status of GoServe, and
requesting special server actions. These command all start with
an exclamation point (!), followed by a word or a phrase.
The special commands are basically built-in "server side
programs". In contrast, the special directives are used to
modify SRE-Filter's logic.
Currently available special directives
- !force/URL
- The
!FORCE
special directive instructs SRE-Filter to
suppress the LOGON_FAIL_FILE feature when considering the URL
.
This guarantees that unauthorized clients will be presented
with a username/password screen.
!FORCE
is meant to be used in the LOGON_FAIL_FILE, where it
provides a means by which a client can try again with a different
username/password. It is also used to force re-compilation
of an HTML document with server side includes (in other words, it
suppresses use of the SSI-Cache).
Examples:
- !FORCE?DIR1/INDEX.HTM
- !FORCE?DIR2/INCS/INDEX.SHT
- !norecord?url
- Instructs SRE-Filter to NOT record this request. It has the same
effect as NORECORD "permission" in the ACCESS_FILE.
- !sendas_mimetype_mimesubtype/dir/filename.ext
- The
!sendas
special action is used to force
the server to send the requested file as mimetype/mimesubtype.
This can be useful if you wish to create links to unusually named
text, or html, files. For example, if you have a series of
html documents named CHAP.1, CHAP.2, etc.; you could use links of
the form:
<a href="/!sendas_text_html/mybook/chap.3">Get chapter 3 </a>
Technical note: !sendas
suppresses SRE-Filter's
extension mapping method of determining the mime type (and subtype);
and uses the explicitly coded mimetype
and mimesubtype
instead.
For information on customizing SRE-Filter's extension mapping,
see the description of MEDIATYP.RXX.
- !delsend/filename.ext
- !delsend is used to send a file from the SRE-Filter TEMPFILE_DIR
"temporary file" directory. More precisely, !delsend will look for
filename.ext
in the TEMPFILE_DIR, send it (if it exists), and then delete it.
!delsend is provided to facilitate writing server side programs that
generate several output files -- the client would be sent back
a response containing !delsend links to these several files.
Notes
-
When a
!force
, !norecord
,
!sendas
or !delsend
request is recieved,
the !cmd portion (i.e.; the !sendas_xxx_yyy/,
or the !delsend/)
are immediately stripped off.
Thus, SRE-Filter's various "URL-specific" operations (such as access control,
or aliasing) are performed on this "stripped" request string.
- You can end the !cmd portion with either a ? or
a /. For example, the following two requests are equivalent:
-
!sendas_text_plain/hello.lst
-
!sendas_text_plain?hello.lst
Currently available special commands
- !authorize
- SRE-Filter will send back an "authorization" request. The primary users
of this will be server administrators -- since a !AUTHORIZE link will
repetitively ask for the client's username/password.
- !ping
- 'PINGS' the client.
- !statistics
- View current GoServe statistics.
- !HOST?xxx.yyy.zzz.aaa
- Get information on IP address xxx.yyy.zzz.aaa
- !reset
- Resets various GoServe statistics, and instructs SRE-Filter to re-read
parameter files immediately (only available to OWNERS, or clients with SUPERUSER
privileges).
- If !reset?params, then statistics will
not be reset.
- !save
- Saves various GoServe statistics to the GOAUDIT.80 audit file.
This is only available to SUPERUSERS, or to users with a CONTROL privilege.
- !ssi
- Used to access information on the SSI-cache. The following
sub-options are recognized:
- !ssi?status : writes a (fairly technical) status report to the PMPRINTF window.
- !ssi?status=short : writes a brief status report to the PMPRINTF window
- !ssi?status=fully_qualified_file_name : writes a report on the SSI-Cache entry
(if it exists) for the
fully_qualified_file_name
- !ssi?reset = Resest (clear) the SSI-cache
- !ssi?remove=fully_qualified_file_name : remove the SSI-Cache entry
(if it exists) for the
fully_qualified_file_name
- !ssi?cleanup = Cleans up the SSI-Cache
Notes:
- The client must have SUPERUSER privileges to invoke these
!SSI options.
- After completion of the !SSI request, a
short status report (in plain-text format) will be returned to the client.
- For an illustration of the use of !SSI, see SSICACHE.HTM
- !variable?var1&var2..
- Returns the value of environment variable var1, etc.
(client must have SUPERUSER privileges to use this).
- !write_cache
- saves the
record_all_file
cache to the record_all_file
- !dir?
dirname
- Invokes SRE-Filter's built in directory lister; which will create
a list of all files (and subdirectories) of
dirname
.
To modify the various display parameters used by !dir, see the
DIR.DOC
file, or see the description of the DIR_EXCLUSION and DIR_OPTIONS
parameters in INITFILT.DOC.
Notes:
- The !CREATE option of the AUTO_NAME parameter
also uses
!dir
to generate a directory listing.
- For a more richly featured directory lister, try the
GETAFILE add-on for SRE-Filter.
Return to table of contents
SRE-Filter supports a simple form of "load balancing". When load balancing
is active, the server will first check the number of active clients.
If this exceeds the number specified in the LOADTHRESHOLD variable, then the
client is redirected to one of the servers listed in the BackupServerList
variable.
For details on how to invoke load balancing, see the description of LOADTHRESHOLD
in INITFILT.DOC
Return to table of contents
In certain cases, you may wish to have a set of
custom written REXX routines
examine the request before yielding control to SRE-FILTER. For example,
you may wish to shunt some special requests to a variety of different
filters.
To do this, set the PRE_FILTER variable:
- PRE_FILTER=NO: no pre-filtering will be attempted.
- PRE_FILTER=YES: a pre-filter (a REXX procedure) will
be called. The pre-filter will be called after
logon privileges have been determined; when individuals do not
have logon privileges, the pre-filter will not be called.
- PRE_FILTER=FIRST: same as PRE_FILTER=YES, except the pre-filter is
called as the very first action (before logon privileges are ascertained).
You can specify the name(s) of the pre-filter procedure file(s)
by setting the
PREFILTER_NAME variable. By default, PREFILTER_NAME="PREFILTR"
(which refers to PREFILTR.80).
When a pre-filter is called, several arguments will be passed. The first
three are generated by GoServe, the second to last is generated by SRE-FILTER and
is not passed when PRE_FILTER=FIRST, and the last offers a means
of transfering results from earlier to later pre-filters.
parse arg source,request,sel,privs,servername,otherargs
source:
myaddr port transaction who whoport
request:
verb uri protocol
sel:
action '?' awords
privset
: list of privileges
servername
-- ip name of server (useful in multi-host
environments).
Other_args
-- results from prior pre-filter.
The pre-filter should return a comma delimited list:
status , status message
Where status is either 0 or 1:
0= No response to client, SRE-FILTER should continue processing.
1=Response to client, SRE-FILTER should exit (perhaps with response recording)
The Status message will be stored as
PREFILTER_RESULT. Note that the
REPLACE PREFILTER_RESULT
keyphrase
can be used to display this status message.
Notes
- If more then 1 pre-filter is called, the PREFILTER_RESULTS
will be from the last pre-filter specifed in PREFILTER_NAME
- If an earlier pre-filter issues responds to the client (and
issues a GoServe "completion code"), the remaining pre-filters
are skipped.
Return to table of contents
The PREFILTR.80 file that comes with SRE-FILTER contains a
pre-filter that enables support for the GoRemote package.
GoRemote (the "server remote control" package bundled with GoServe)
is typically called as a special filter. By using this pre-filter, GoRemote
will automatically be called (instead of SRE-FILTER) when a GoRemote
specific action is requested.
To do this, you'll need to:
- Obtain the GOREMOTE package, and unarchive it to either the root of
your data directory, or to the GOREMOTE/ subdirectory of your data
directory. You'll need GOS32.GIF, GORM*.HTM and GOREMOTE.* files.
Since there are about a dozen GORM* files, placing them
a subdirectory is asthetically preferable.
- Copy GOREMOTE.80 to your working directory. If GOREMOTE was
installed in a GOREMOTE/ directory, copy GOREMOTE.HTM, GOS32.GIF and GORMOK.HTM to the
root of your data directory
- Make sure that PREFILTR.80 (the one that comes with SRE-FILTER) is
also in your working directory.
- Using CONFIG2.HTM (or by direct modification of the INITFILT.80 file),
set the PRE_FILTER variable to:
- YES = If you want to limit access to GoRemote:
- Clients with SUPERUSER or INHOUSE privileges will be able to
view filter settings and statistics.
- Clients with SUPERUSER privileges will be able to change settings.
- FIRST = If you want all clients to have access to GoRemote
You should also set PREFILTER_NAME='PREFILTR.80'
- Set up a link to GOREMOTE (or GOREMOTE/GOREMOTE if
you installed GOREMOTE in a GOREMOTE subdirectory).
- You do not need to make any other modifications, either
to SRE-FILTER, or to the GoRemote files!
Notes:
- This pre-filter works by capturing all calls to GOREMOTE.*, GOS*.*, and
GOR*.* (or to these files in the GOREMOTE/ directory).
So, if you use this pre-filter, don't create files with these names (though
you can create files with these names in different subdirectories).
- When calling GOREMOTE, do not call it as
GOREMOTE.HTM (the GoRemote filter is not expecting to see an extension).
Return to table of contents
In certain cases, you may wish to execute some additional actions
after responding to a client's request. For example, you may
wish to record client specific information in a custom designed audit
file. Or, you may wish to e-mail responsible parties
when certain events occur (such as a file upload). Or you may wish
to do both!
To accomodate such needs, SRE-FILTER can be told to call a
series of "post-filters". As with
the "pre-filter", these post-filters are custom designed REXX procedures.
To enable post-filter calling, set the POST_FILTER variable:
- POST_FILTER=NO: post-filter(s) are not be called.
- POST_FILTER=YES: post-filter(s) are called.
Note: The post-filter(s) are called after a response
has been sent to the client.
Therefore, you can not
use a post-filter to modify the response
sent to the client!
You can specify the names of the (possibly several)
post-filter procedure files by setting the
POSTFILTER_NAME variable. By default, POSTFILTER_NAME="POSTFILT".
To specify several post-filters, just enter a space delimted list.
For example POSTFILTER_NAME="POSTMAIL.80 POSTRECRD.80 "
--
they will be executed in the order of appearance.
Note that if there is no extension, and no ending period, an extension of
.80 is assumed (or .nnn if you are using a non-80 serverport).
When a post-filter is called, several arguments will be passed:
- amessage : a short SRE-FILTER status message
- source : The server address and client address
- request: The verb and request string
- sel: The request string
- tempfile: The temporary file used by this transaction
- servername: The host to whom the request was directed (the
servername)
- host_nickname: The "host nickname" corresponding to
the servername (or blank, if there is no HOSTS. variable for servername)
- USED_FILE: The fully qualified file used by the request:
such as the HTML file requested by the client,
or the CGI script executed by the server.
- TheReferer:
The value of the 'referer' request header -- if set, it contains
the fully qualified url which contained the link which invoked this request.
- Thread id. Useful if you need to access "state information"
(for details, see the description of the SAVE_STATE variable in INITFILT.DOC).
For a simple example of a post-filter, see the POSTFILT.80 file that comes
with SRE-FILTER. More useful examples are contain in POSTMAIL.80 (an
e-mail alert routine) and POSTRCRD.80 (a client info recorder).
The POSTMAIL.80 that comes with SRE-FILTER uses the SREF_MAILIT procedure (contained in
the SREFPRC1 macrospace procedure library) to
e-mail "event specific" alerts through an SMTP Gateway.
A different (set) of individuals can be notified
for each of a set of events, where events are identified by the
request string (with wildcard matching supported),
or by the requesting client's IP address.
POSTMAIL.80 contains detailed instructions on how
to generate these e-mail alerts.
Notes:
- To use this facility, you must set the SMTP_GATEWAY variable to be the address
of your SMTP server. If you do not have access to an SMTP server, you might be able to use OS/2's SENDMAIL
program to set up your server machine as a SMTP server
(see the OS/2 TCP/IP Command Reference for more information on SENDMAIL).
- Ambitious programmers can use SREF_MAILIT for more advanced e-mail purposes.
Return to table of contents
SRE-FILTER provides two built-in "actions" for uploading files,
one HTTP method
for uploading files, and one HTTP method for deleting files.
Each of these has it's own advantages
and disadvantages:
- GET_URL: A built-in action for uploading files from another HTTP server
- Requires that the client has ready access to an HTTP server.
- Given this access, uploading is quick and easy.
- PUT_FILE: A built-in action for uploading files from the client's own machine
- Requires that the client be using a browser that supports the
type=file
FORM attribute.
- NetScape 2.01 properly supports it.
- The PUT method.
- Requires that the browser (or other software) know how
to issue a PUT method HTTP request. The DOPUT.CMD program illustrates
the use of the PUT method.
- The DELETE method. This can be used to delete files from
your server. As with the PUT method, it requires a browser that
knows how to issue DELETE method HTTP requests.
General Usage notes:
- GET_URL.
Set up a URL with the GET_URL action,
followed by the
URL of the file you want to get, and the "local name". The request
string should look like: GET_URL?url=http://a_url&file=relative_file_name
For example:
-
GET_URL?url=http://www.pc.com/price.lst&file=pcprice.1
will copy price.lst
(on the server at www.pc.com
) to a file named PCPRICE.1 (in
the upload directory
).
- PUT_FILE.
Create an HTML FORM with a type=file
attribute. For example:
<FORM enctype="multipart/form-data" ACTION="/put_file" METHOD="post">
Send this file <INPUT TYPE="file" name="relative_filename">
<INPUT TYPE="submit" VALUE="send file">
</FORM>
- The PUT and DELETE HTTP methods are, by default, not permitted.
To allow PUT or DELETE methods, you must include a PUT or a
DELETE permission in the permission list of the
appropriate entry (for the requested URL) in the ACCESS_FILE.
- PUT and DELETE refer are relative to the data directory, or to a
local virtual directory.
PUT_FILE and GET_URL usage Notes
- PUT_FILE and GET_URL store
results in files relative to the UPLOAD_DIR directory, or to a "local"
virtual directory. Note that if the target is a virtual directory,
a PUT permission must exist for the specified file.
For example, if the relative file name is TODAY/OUTPUT.1, and
TODAY has a virtual directory match, then access controls for TODAY/OUTPUT.1
will be examined for a PUT permission. In contrast, if TODAY has no virtual
directory match, then output is assumed to be to the TODAY subdirectory of
the UPLOAD_DIRECTORY -- and the PUT permission is not needed.
- Files must be less then UPLOAD_MAXSIZE in kbytes size;
and there must be UPLOAD_MINFREE kbytes free (in the UPLOAD_DIR
directory)
after the file is uploaded. If either condition can not be met, the file will
not be uploaded.
- If the filename (after resolving for is directory) exists,
an error message will be returned.
- If you do not specify a local file name, SRE-FILTER will create a
"unique" file name in your UPLOAD_DIR directory.
You can specify "partially random" filenames by including ? characters in the filename.
SRE-FILTER will attempt to create
a unique file name by appropriate substitutions of the ? character. For example:
- if filename=ABC??.TXT,
- and ABC01.TXT exists,
- then SRE-FILTER will use ABC02.TXT.
- For GET_URL: You must completely specify the URL (including the http:// portion).
- A short status report on success of the upload operation is written to the
UPLOAD_LOG file.
- For PUT_FILE: Browsers that do not support the
type=file
FORM attribute will send back garbage (that will be ignored).
- UPLOAD.HTM contains an example of the use of GET_URL and PUT_FILE.
Return to table of contents
If desired, SRE-FILTER will parse a requested document, extract all LINK and
META HTTP-EQUIV elements found in the <HEAD>, and create the
appropriate response headers. This is especially useful
in response to HEAD requests.
To do this, set the value of the AUTO_HEADER variable:
- NO : Do not create response headers
- HEAD: Create response headers when a HEAD HTTP method request is recieved for
an HTML document.
- ALWAYS: Create response headers whenever a GET or HEAD request is recieved
for an HTML document.
Notes
- GoServe automatically generates several response headers (such
as content-length and file-creation-date).
- Server side includes (that might be in the <HEAD>) are not processed when a HEAD
request is recieved. Furthermore, server side includes are not processed
when response headers are created, but are processed when
the <HEAD> is returned as part of the document.
Thus, if you intend to use AUTO_HEADER,
we recommend not using server side
includes in the <HEAD> portion of your HTML documents!
- From an HTTP purist basis, the use of AUTO_HEADER="HEAD" would be
discouraged, since the response headers returned by a GET and a HEAD request
would be different. However, since many browsers understand that
LINK and META EQUIV elements (in the <HEAD> section of an
HTML document) are equivalent to response headers, this is probably
not
a serious drawback.
Return to table of contents
SRE-Filter recognizes a list of the most frequent MIME media types (using the
extension of the requested file). If you want to add to this list, you
can do so by editing the MEDIATYP.RXX
file located in your
GoServe directory.
Additions to MEDIATYP.RXX may be new media types
(say, an experimental MIME type),
or they may be assignations of a non-standard extension to a common MIME type
(say, .DOCUMENT to text/plain).
Notes
- MEDIATYP.RXX
is checked only when the requested
file has an extension that does not match one of SRE-Filter's pre-defined
media types. Therefore, it can not be used to redefine
a built in media type
- Instructions on how to modify MEDIATYP.RXX are contained in
the copy of MEDIATYP.RXX that ships with SRE-Filter.
- If you add new text/html entries, and you want these to be equivalent to
SHTML entries (that is, html entries with server side includes permitted), you
should edit the SSI_EXTENSIONS variable in SREFILTR.80 (see INITFILT.DOC for
details).
Return to table of contents
Some useful facilites provided with SRE-FILTER
Searching files using DOSEARCH
The DOSEARCH add-on for SRE-Filter is a generic search utility written in REXX. It searches
one (or several) ASCII text files for "paragraphs" that satisfy a set of conditions that are
specified in a "search string", and returns an HTML document containing
these paragraphs.
Using DOSEARCH.HTM
DOSEARCH.HTM is an HTML document that directly calls DOSEARCH -- it does
not require using an ALIAS or an <ISINDEX> element. It also provides
an easy means for setting a number of DOSEARCH options. If you are familiar with
HTML FORMS, you can customize (and rename) DOSEARCH.HTM. In particular,
to facilitate searches (say, of a specific document)
many of the TYPE fields can be set to be HIDDEN.
DOSEARCH details
DOSEARCH looks for "search strings" within "paragraphs", and uses "meta
commands" and "target specific" instructions to structure the search.
By default, a paragraph is defined as being
all text between blank lines. Alternatively, one can define paragraphs as single lines,
or as delimited by any arbitrary character sequence.
A search string is comprised of "targets" There are two kinds of targets:
subwords
and phrases.
Each space delimited entry in the search string is treated
as a seperate subword
, except..
for phrases
, which are delimited by parenthesis; for example: (xx yy zz)
.... and phrases must be matched precisely.
Search algorithims.
DOSEARCH has two modes: SIMPLE and LOGICAL.
Simple mode with highlighting.
Two meta-commands and 4 "target specific" instructions are recognized.
Meta-commands are signified by *& or *\ at the beginning
of the search string.
*& means "find paragraphs that match ALL targets in
the search string"
*\ means "find paragraphs that match NONE of the targets in
the search string"
If there are no meta-commands, the following target specific
commands are recognized.
& means "paragraphs MUST have this target"
| means "accept paragraph if it has this target"
Note that | is the default (assumed if no target specific
command entered).
\ means "paragraph must NOT have this target"
% means "accept paragraph if it does NOT have this target"
Summarizing: to be a "found" paragraph:
Test 1a) Any (of several) | targets must be present, or
1b) All of the % targets must be missing
If pass test 1a and 1b, then
2a) None of the \ can be present, and
2b) All of the & must be present
If present, all & and | targets will be highlighted.
Note that if there are no % targets specified, test 1b is ignored.
Logical expression mode without highlighting
The user enters REXX-like logical expression using the following operators:
& : AND operator
| : OR operator
\ : NOT operator
@ : XOR operator
( ) : to group expressions.
A sequence of words without any operators is treated as a phrase -- to
treat each word as a seperate subword, put ( ) around each one.
Basically, when using this mode, be liberal in your use of ( ).
DOSEARCH Options
DOSEARCH supports a number of options.
These options are easily set in
DOSEARH.HTM, or by modifying the ALIASE(es) that invoke DOSEARCH.
Technically speaking, the options appear in an option list,
with each option seperated by an & character.....
- if the GET method was used, the option list is placed
after a ? character in the request string.
- If the POST methed was used, the option list is placed in the body of the request.
The option list should have the structure:
option_name=option_value&option_Nam2=option_value2&...
The DOSEARCH options are:
DELIM : The paragraph delimiter.
" " or 0 = blank lines (the default)
"$" = Each line is a paragraph
other = User specified delimiter
LINE : Maximum number of lines to display of each "found" paragraph.
If 0, no lines displayed (a summary will be displayed)
Default is to display all lines.
NUM : YES=Display the line or paragraph number,
NO=Don't (default=YES)
BAR : YES= Seperate each paragraph/line by a horizontal bar,
NO=Don't (default=YES)
EXPERT: YES= Use "logical expression mode",
NO=Use simple mode (Default=NO)
FILE : FILE=filename
A file to search (either relative to the data directory,
or in a "local" virtual directory). You can include as many
FILE options as desired (each entry will be searched in turn).
Furthermore, * and ? wildcards can be used.
SEARCH: The search string
CASE : If YES, then search is case sensitive (default is NO)
Examples
Simple mode examples
-
( The best car)
- Finds paragraphs containing the phrase
the best car
-
car truck motorcycle
- Finds paragraphs that contain one (or more) of
car, truck
or motorcycle
-
dog cat & store (pet pig)
- Finds paragraphs that contain one (or more) of
dog, cat
or the phrase pet pig
;
and that also contain store
-
*& computer price memory
- Finds paragraphs that contain
computer, price
, and memory
(must have all of them, but can be in any order)
Logical mode examples
-
The best car
- Finds paragraphs containing the phrase
the best car
-
car | truck | motorcycle
- Finds paragraphs that contain one (or more) of
car, truck
or motorcycle
-
( (dog & cat) | (pet pig) ) & stores
- Finds paragraphs that contain
stores
, and that contain either both dog
and cat
, or the phrase pet pig
Return to table of contents
The SENDFILE facility
SENDFILE is an SRE-FILTER facility that transfers files to a client.
It can record the number of times this file has been completely sent.
SENDFILE is invoked with a request string of:
SENDFILE?url&forcetext=1&COUNTER=option_list
(the &forcetext=1 and &COUNTER=option_list are optional)
SENDFILE will ...
- Check for the existence of a file corresponding to the
URL
(the file that the URL maps to is assumed to be
relative to the data directory or relative to a "local" virtual directory).
- Look in the SENDFILE_FILE
for an occurence of the
URL
. If none exists, create an entry.
- If the
URL
exists (and the entire file was sent), the
"count of requests" for this URL is augmented. That is, if the client
killed the connection half way through, the count will not
be augmented.
- If a COUNTER=... options is present, COUNTER.RXX will be used (with
the option_list).
- If SAVE_STATE=1 the
number of bytes sent
and the size of the file
are stored in a SENDFILE_STATUS variable in the "thread
specific" cache.
- A successful transfer will have the "number of bytes sent"
equal to the "size of the file".
- SAVE_STATE is set in SREFILTR.80 -- see INITFILT.DOC for details.
Notes
- If the client breaks the connection before the a file
is completely sent, the SENDFILE_FILE is not modified (the request
is not recorded). However, if SAVE_STATE=1, the SENDFILE_STATUS variable will be written.
- By default, SENDFILE_FILE
is SENDFILE.CNT.
- When ACCESS_ALLOW is binding, the
ACCESS_FILE should contain an entry of the form
SENDFILE?*
- The SENDFILE_FILE supports wildcard matching.
- For details on the COUNTER= option_list, see COUNTER.DOC .
-
If
FORCETEXT=YES
, SENDFILE will
assume that all files are of "mime-type text/plain". This
can be a useful trick (it tricks the client into displaying everything
as a text file), but if .GIF (or other non-text files) are chosen,
garbage will be displayed ( use this option with discretion)!
- Entries in the SENDFILE_FILE may be "host specific".
Return to table of contents
Using Message Boxes
SRE Filter's built-in message box facility provides a mechanism for storing messages
from clients. SRE-Filter provides a few simple built-in tools for manipulating
these messages boxes. These include:
- A message writer. The message writer is invoked with
a request string of:
MESSAGE?messbox=messagebox&field1=value&..&fieldn=value
- Two simple facilities (VIEWMESS and ASKMESSBOX) are provided for
viewing an entire message box.
- message box access can be controlled through the use of
message box privileges.
Of perhaps greater interest, the FORUM, READMAIL,
and MAILIST
SRE-Filter add-ons make extensive use of these
SRE-Filter messages boxes.
The Message Writer
The message writer is usually invoked with an HTML FORM with ACTION="/MESSAGE" (see
SAMPMBOX.HTM for an example). In addition to an INPUT element identifying
the "message box", you can specify a number of fields (the field name, and it's
value, are written to the message box using an e-mail type format). Several
of these fields are treated specially, as explained below:
- MESSBOX (recommended)
- The particular message-box to put the note into.
If a MESSBOX field is not included, the note will be put into the ANYONE message-box.
If MESSBOX names a non-existent message-box,
a new message-box will be create.
- NAME and SUBJECT (recommended)
- These are expected, if not included a dummy value will be created.
Note that each message is automatically given a TIME and DATE stamp.
- FAX, E-MAIL, ADDRESS, and PHONE (optional).
- The name, and value of these fields are written to the message box.
Note that the E-MAIL field is explicitly used by SRE-Filter's FORUM add-on.
- PASSWORD and DURATION
- The PASSWORD and DURATION fields are used by the FORUM add-on to control "delete privileges"
for a given message. It will be encrypted before being written to the
message box file. Note that messages boxes are not designed for security (the encryption is weak),
so don't use them when confidentiality and integrity are important.
- INDEX
- Including an
INDEX=YES
field will cause MESSAGE to
update an index file (with an .IDX extension). These .IDX files are
used by the FORUM add-on to speed up response. Note that this
.IDX file creation will occur after responding to the client (it's
a post-filter type of action) -- the client will not notice any
adverse impact from inclusion of an INDEX=YES
field
(but other clients may be impacted by the extra workload!)
- BROADCAST_LIST
- If included, SRE-Filter will simultaneously e-mail (through the SMTP gateway
you set with the SMTP_GATEWAY variable) copies of your message to
a list of e-mail addresses. This list, a file with name given by BROADCAST_LIST,
must be in (or under)the MESSBOX_DIR. Furthermore, the client must
have SUPERUSER or BROADCAST privileges, or a privilege equal to the
value of BROADCAST_LIST. If not, an authorization request will occur.
Note that the BROADCAST_LIST file should contain valid e-mail
addresses, one per line.
- BROADCAST_ONLY=YES
- Do not write to message box, just BROADCAST
- BROADCAST_NAME=My_name
- Used in the "from" field of the e-mail message.
- WRITE_TO_FILE=YES
- If included, SRE-Filter will write an "E-mail" like file (containing
From, To, Date, and Subject fields; followed by the Contents) to your
MAILBOX_DIR directory. These files are designed to be read, and
processed as an "e-mail message to a list-server", by the MAILLIST (and READMAIL)
SRE-Filter add-ons.
If you are broadcasting to many recipients, the use of WRITE_TO_FILE
in conjunction with the MAILLIST add-on, rather then the BROADCAST_LIST, is recommended.
.
- Other names (optional).
- The name, and value, of these fields will be written to the message box.
The difference between "other names" and the PHONE, ADDRESS, and FAX "optional"
fields is merely in the order of appearance.
- RESPONSE_FILE
- The RESPONSE_FILE field is used to indicate a file contaning a "response"
to a posted message. If no RESPONSE_FILE is included, a very simple generic
response will be
returned.
- MESSAGE (recommended)..
- The (multi-line) message. It's written last of all.
The direct means of reading a message box is to simply view it using the OS/2 TYPE
command (message boxes are ASCII files, with a .LOG extension, located
in the MESSBOX_DIR directory).
SRE-FILTER also provides a simple mechanism for remotely viewing these
message boxes.
A request string of VIEWMESS?messbox=message_box
will
cause SRE-FILTER to transfer the message-box-file to the client.
SRE-FILTER also provides a simple routine that generates an HTML document
that displays a list of all available message-boxes,
and let's the client choose which one to view.
This routine can be invoked with a request string of
askmessbox?An+optional+header
The "optional header" is displayed as an <H2> at the top of the document.
To access a message box with MESSAGE (or with the FORUM
add-on),
the client must have
"message box specific" privileges. These are specifed by including
(in the client's privilege list), entries of the form:
MESSBOX=a_message_box.
For example: MESSBOX=FORUM1
would give (read/write) access
to the FORUM1
message box. Note that this is in addition
to any "URL and FILE specific" access controls you may have imposed.
The a_message_box
portion of the privilege can
contain the * "wildcard" character. For example, MESSBOX=FORUM*
would provide access to FORUM1, FORUM2, etc.
On installation, SRE-Filter includes MESSBOX=*
in the
PUBLIC_PRIVS parameter (the effect of which is to allow
open access all message boxes). You'll need to remove this from
PUBLIC_PRIVS if you want to limit access to message boxes!
Notes
- You can also limit to message boxes by creating an entry in the ACCESS_FILE
of the form:
MESSAGE* resource_privilege_list
(you may also want to create similar entries for
VIEWMESS and ASKMESSBOX)
Return to table of contents
The SRE-FILTER procedure library
SRE-FILTER uses a procedure library (that is loaded into
macrospace) to provide many functions.
Several of these routines may be quite useful to the ambitious REXX programmer.
These procedures include:
- SREF_MEDIATYPE: Return the MIME type of a file (based on it's extension)
- SREF_REPLACESTRG : Replace substrings
- SREF_MULTI_SEND: Expedites the creation of multi-part documents
- SREF_GRAB_FILE : Wait for file to become unlocked, and then
read it into a variable.
- SREF_FIX_URL : Given a local URL, and servername, and a serverport, return
a legitimate URL (including the http://).
- SREF_WILDCARD : Perform a wildcard substitution.
- SREF_JULDATE: Return the Julian date and time (days since 0/0/0, time in fraction)
- SREF_MAILIT : Send an E-mail message.
- SREF_CGIVARS : Determines one of the "CGI-BIN" variables.
- SREF_BROWSER_INFO: Check on the capabilities of the client's browser.
A complete description of these routines can be found by
downloading SREFPRC1.DOC..
For serious programmers, the
source code
is also available.
Return to table of contents
SRE-Filter Add-ons
SRE-Filter has a number of add-ons avaiable. You can download them
from the
http://rpbbcam.econ.ag.gov/srefilter site.
Currently, the add-ons include:
-
FORUM: A news-group and list-server discussion-group package.
The FORUM add-on consists of three components:
- FORUM:
The FORUM component provides a simple, but
fairly complete, multi-threaded "news group" like capability. The basic
output of FORUM is a list of "links" to messages in the message box.
The list is organized hierarchically, with indentation used to indicate
discussion threads.
Clinking on a link causes
just that message (and it's various "fields") to be displayed. The client then
has a number of options: including sending a response to the message poster (given that an
e-mail address is available), posting a new message to the message box (either
as a response to the message, or a as new entry in the discussion thread), or
viewing the next message or the next thread.
- READMAIL:
The READMAIL component that will transfer
mail to SRE-Filter message boxes. This mail is read from the
incoming mail directory of an SMTP-gateway running
on your server; for example, the SMTP-gateway provided by OS/2's
SENDMAIL daemon. By combining READMAIL, and the BROADCAST_LIST
option of MESSAGE, a simple "list server with automatic archiving" can
be implemented.
- MAILIST:
MAILIST is nearly identical to READMAIL, but is designed to run independently
of SRE-Filter. MAILLIST requires somewhat more configuration, but once
running does not suffer from "timing out" problems due to GoServe limitations
on connect time. It also automatically checks for new mail on a timed basis; in
comparision, you have to explicitily invoke READMAIL (say, by
using READMAIL.HTM).
-
BBS: A full featured "web based bulletin board system"
BBS is a WWW bulletin board system. BBS features include:
- Individual file descriptions can be displayed, along with
file size and creation date.
- Directory specific inclusion files (i.e.; FILES.BBS) and exclusion
files can be used to control file and sub-directory display.
- Optional "automatic descriptions" can be generated for
HTML, .ZIP, and text files.
- .ZIP files can be "opened and displayed", with subsequent retrieval
of a specific file from within the .ZIP archive
- Netscape 2.01, and other HTML 3.0 compliant browsers, can upload
files by using a FORM containing a file="type" element.
- Uploads and downloads can be recorded on a per user basis.
- A flexible access control mechanism allows customizaton of which
file areas a user can peruse.
- Downloads can be disallowed if a user's "download to upload" ratio grows
too large.
- Directory specific headers, footers, and "exclusion lists" can
be specified.
- Optional caching of directory-listings can greatly speed up throughput.
-
GETAFILE: A directory displayer, with user-settable display features
GETAFILE is a similar to SRE-Filter's !DIR dynamic directory display facility.
It is somewhat easier to configure, and has a few extra bells and whistles.
- SRCHINDX: An SRE-Filter front-end to the SWISH indexing
facility. With SWISH and SRCHINDX, it's easy to set up a "searchable index"
of your web site.
-
CALC: A character-mode scientific calculator with a web interface
CALC is a WWW-accessible scientific calculator.
It uses a keyboard interface, and
is based on an aging DOS program. On the other hand, it's quite feature
rich: multiple equations and temporary variables can be specified, trigonometric functions
are fully supported, analytic derivatives can be taken, and more...