Abstract: | SREhttp/2's selector-specific "advanced options" are used for a variety of purposes, including setting parameters, enabling less-frequently used options, and executing mid-filter procedures. |
---|
REALM: Myrealm RULE: /SAMPLES/* Option: header add X-Grader: this is a mediocre resource Option: set expires 0.1 Realm: HerRealm Rule: /VIOLET/* Option_file: cfg/her_opts.optExample of OPTION_FILE:
header: add X-Confirm: 13 ssi_no code set pre_response 0
Note: | The examples in this document assume that one is creating
an OPTION_FILE. If, instead, you are adding options directly to an ATTRIBS.CFG file,
you should simply add Option: to the begining of the examples.
For example:
|
---|
As detailed in OUTLINE.HTM, request processing involves these steps:
Syntax:
EXEC filename opt_string
where:
filename: | a filename of the rexx procedure to execute. | |
opt_string: | an optional argument sent to "filename" (when it is called) |
The EXEC procedure will be sent a set of variables:
ARGUMENT | The "argument" following the procedure-file name. This may contain commas (a comma containing ARGUMENT does not result in multiple arguments being sent to the called procedure). In the above example, ARGUMENT would be Hello from job 1. |
SOURCE | The SRE2003 source argument |
REQUEST | The SRE2003 request argument
For example: GET /test1? HTTP/1.0 |
SELUSE | The (SREhttp/2) modified selector (after redirection & ~ replacement) |
SERVERNAME | The name of the server that this request was sent to |
HOST_NICKNAME | SREhttp/2 host nickname for the server processing this request |
DataDir | The (possibly host-specific) HTML documents, & other web-accessible files, data-directory |
PRIVSET | The client-privileges assigned to this client |
ID_INFO | The ID_INFO parameter |
An EXEC procedure can return either:
This response header customization is only available for GET and HEAD requests that invoke a file transfer (including HTML documents with server side includes).
That is, for "server side processing" requests (such as CGI-BIN scripts, SREhttp/2 addons, PUT and DELETE requests, and imagemaps) HEADER and RESPONSE entries will not be used.As a convenience, SREhttp/2 will perform a few substitutions on HEADER and RESPONSE entries:
$GMT | The current GMT day, date and time. | |
$SERVERNAME | The "site name" to which the request was sent | |
$SIZE | The number of bytes to be sent | |
$CODE | The status code (almost always 200) |
response HTTP/1.1 406 Variant not available header X-Webmaster-Name: Daniel Platypus header drop expires header X-comment: X- headers are created by SREhttp/2 header X-Our-server: $servername header X-Size-1: this is $size size header X-Code-1: this is $code code
Syntax:
SSI_NO opt1 ... optn
The available OPTn options are:
replace_rules | do not use the replace-rules | |
cache | suppress caching (similar to a <-- CACHE NO --> keyphrase) | |
footer | Do NOT include FOOTERS lines | |
header | Do NOT include HEADERS lines | |
include | Do NOT process <-- INCLUDE filename --> keyphrases | |
interpret | Do NOT process <-- INTERPRET FILE filename --> or <-- INTERPRET CODE xxx ;yyy --> keyphrases. | |
replace | Do NOT process <-- REPLACE varname --> keyphrases | |
select | Do NOT process <-- SELECT xxx --> ... <-- SELECT END --> keyphrases keyphrases | |
#config | Do NOT process <-- #CONFIG ... --> keyphrases | |
#echo | Do NOT process <-- #ECHO ... --> keyphrases | |
#exec | Do NOT process <-- #EXEC ... --> keyphrases | |
#filestat | Do NOT process <-- #FLASTMOD ... --> or <-- #FSIZE ... --> | |
#include | Do NOT process <-- #INCLUDE ... --> keyphrases | |
#if | Do NOT process <-- #IF ... --> keyphrases | |
#set | Do NOT process <-- #SET ... --> keyphrases | |
Notes: |
|
Examples:
ssi_no cache ssi_no header footer ssi_no select #echo #exec
You should have, at most, one MIME line per selector (latter entries are ignored).
The syntax is:
REPLACE old_string==new_string
REPLACE </HEAD>==<BASE href="http://main.site.url"> </HEAD>where main.site.url should be the IP address of the main-site.
These are:
DEFAULTS | a list of default index files to use (if no file specified) |
EMPTY_PATH_OKAY | allow an empty PATH_INFO cgi-bin environment variable |
ENABLE_CGI_PIECES | allow, or suppress, sending CGI-BIN output in pieces (as it becomes available) |
ETAG | specify an etag, or how to auto-create an etag |
EXPIRES | add an offset to an otherwise immediate expiration |
GET_PRIVS | force SREhttp/2 to obtain client privileges |
IM | disable or specify Instance Manipulation |
LIMITtimeINACTIVE | number of inactive seconds to grant this request to finish |
LIMITtimeTOTAL | number of seconds to allow this request to finish |
MD5 | add an Content-MD5 response header |
NOTIFY_MESSAGE | message used in a NOTIFY redirection |
POST_RESPONSE | suppress the use of "post-response" procedure(s) |
PRE_RESPONSE | suppress the use of a "pre-response" procedure, or specify a message to send to a pre-response procedure |
PUT_OVERWRITE | Allow PUT method requests to overwrite files of the same name. |
DYNPRIV_DURATION | Duration of dynamic privileges, in minutes. |
The syntax to use is:
SET varname value
Some examples:
SET ENABLE_CGI_PIECES 0 SET ETAG SIMPLE SET ETAG AUTO2 SET ETAG "eT9fdty" SET EXPIRES 0 (do not add an offset) SET EXPIRES 0.66 (add a 0.66 day offset) SET LIMITtimeTOTAL 150 (allow 150 seconds to complete response) SET LIMITtimeINACTIVE 50 (allow 50 seconds of inactive time) SET PRE_RESPONSE 0 SET PRE_RESPONSE ENCRYPT SRE_A SET PRE_RESPONSE DEFAULT SET POST_RESPONSE Class=Red Cars SET PUT_OVERWRITE 1 SET IM 0 (0 means disable) SET IM DELTA SET MD5 0 (suppress generation of Content-MD5 header) SET MD5 1 (add a Content-MD5 header) SET NOTIFY_MESSAGE Or, you can try <a href="altpage.htm">an alternative</a> SET DYNPRIV_DURATION 35
the details ... | |||||||
---|---|---|---|---|---|---|---|
DEFAULTS | A space delimited list of filenames (without path information).
These are used if the request selector is for a directory, and contains
no filename. Basically, this is a selector-specific replacement for the
SREhttp/2 DEFAULTS parameter.
Note: this is only useful when used with rules of the form:/foo/bar/* or /foo/bar/ |
||||||
EMPTH_PATH_OKAY | Set to 1 to enable support for empty cgi-bin "paths", 0 to disable. The default value of EMPTY_PATH_OKAY is a user-configurable parameter that is declared in the SREH2INI.RXX file (in the \SRE2003\SREHTTP2 directory). |
||||||
ENABLE_CGI_PIECES |
ENABLE_CGI_PIECES=0: disable -- do not send in pieces ENABLE_CGI_PIECES=1: enable -- do send in pieces Enabling means that SREhttp/2 will try to read CGI-BIN output as it is written, and then send these pieces. This is useful for long scripts that produce intermittent output.
|
||||||
ETAG | Explicitly specify an etag to include in the response. Or, specify the method used to create an etag. The syntax of ETAG follows that of the ETAG option of SRE_COMMAND.
|
||||||
EXPIRES | Set a expiration time (using a Expires: response header).
The syntax of EXPIRES follows that of the EXPIRES directive of SRE_COMMAND |
||||||
GET_PRIVS | Force SREhttp/2 to try and obtain client privileges.
Using SET GET_PRIVS 1 has the same effect as setting the ALWAYS_GET_PRIVS=2 SREHTTP2.CFG parameter. Similarly, SET GET_PRIVS 0 is equivalent to ALWAYS_GET_PRIVS=0 |
||||||
IM | IM is used to override the IM_DEFAULT option (in SRE2003.CFG). IM 0 means "suppress Instance Manipulation" (such as delta encoding). You can also use IM xxx to select an instance manipulation method, where xxx must be one of the IM types specified in the SRE2003.CFG IM_TYPES variable. |
LIMITtimeINACTIVE and LIMITtimeTOTAL |
LIMITtimeINACTIVE and LIMITtimeTOTAL are used to override the SRE2003 time limit (in seconds) variables -- but only for this request. | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
MD5 | 1 to enable, or 0 to suppress, creation of an MD5: response header.
MD5 is used to override the DOMD5 parameter (in SREHTTP2.CFG). |
||||||||||
NOTIFY_MESSAGE | NOTIFY_MESSAGE is only used in conjunction with a NOTIFY redirection rule. If used, it should be a simple message included in the "notification" that is sent to the client (it may contain HTML tags). | ||||||||||
PRE_RESPONSE | PRE_RESPONSE can take the following values:
|
||||||||||
POST_RESPONSE | POST_RESPONSE can take the following values:
See POSTRESP.HTM, for more details. |
||||||||||
PUT_OVERWRITE | Allow (1), or disallow (0), PUT method request to overwrite pre-existing files.
The (possibly host-specific) default value of PUT_OVERWRITE
is set in SREHTTP2.CFG.
|
||||||||||
DYNPRIV_DURATION | DYNPRIV_DURATION should be a number greater then 0.
It is the lifespan, in minutes, of dynamic privileges granted
in conjunction with this resource. Note that this overrides
the 15 minute default, but does not override an explicit duration.
|
Basically, if more then this number of requests for this resource are currently active, the server will respond with a Server busy, try again in a few minutes. This can be a useful means of limiting access to CPU intensive scripts and addons.
Syntax:
4 arguments (seperated by a comma) can be included in the Option: EXEC MAX_USER.REX line in your possibly host-specific ATTRIBS.CFG file.
family | the set of resources to which the max_users applies
The family can extend across hosts, and across multiple realms --
in other words, families are
not intrinsically host specific, and are not intrinsically selector specific.
This implies that you can have multiple entries (each with it's own rule and realm name) that use the same family. |
---|---|
max_users | the maximum number of users |
maxuser_failure_file | a failure file to use (if max_users is binding) |
retryafter | Number of seconds to use in a Retry-After header. If specified, a Retry-After response header is added to the maxuser_failure_file response (http/1.1 clients can use Retry-After response headers to automatically re-request the resource). |
Option: EXEC max_users.rex Option: EXEC max_users.rex family1 Option: EXEC max_users.rex familyN, 6, FailFamn.htm , 30 Option: EXEC !max_u familyN ,4
if you intend to use MAX_USER.REX frequently, you might want to use the LOAD_EXEC option (in PRELOADS.CFG) to "load" this code into macrospace.
<!--#URL--> | phrases are substituted with the request selector. |
<!--#SERVER--> | phrases are substituted with the servername. |
<!-- #MESSAGE --> | phrases are substituted with a short description of the reason for failure |
<!-- #LINK --> | phrases are substituted with a URL which points back to this resource |
;------------- Begin Example ------------ ; call the sample external procedure exec exec_smp.rex This is an argument , with commas embedded. ; ; add a custom response header header add X-Webmaster-Name: Timothy Platypus ; ; Suppress headers, footers, and server side "excludes" ssi_no header footer ssi_no select ; replace some strings in SSI html files replace C.== $ Customiz ; suppress content-md5 header set md5 0 ;------------- End Example ------------