httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Holsman <I...@cnet.com>
Subject Some modules from CNET.
Date Mon, 09 Apr 2001 21:06:28 GMT
Hi.

we're in the process of clearing this through our legal department, but am i
writing this note to 
see if there is sufficent interest in these modules. 

I can only post a summary of what they do at the moment.

mod-pathfixer:
is a fast name translation handler which does non-regex replacement, we use
it instead of mod_rewrite.

PFAddPath <from> <to> <func> internal|external [<tag>] [disableQueryString]
In the PFAddPath command, 
<from>: The prefix to look for. 
<to>:   The text to change the prefix to. 
<func>: The function to use to do the transposing. 
internal|external: The mode to use for redirection (internal, external). 
<tag>:  Provide a set of query string to be put at the end of an external
redirection. 
disableQueryString: Set if you do not want the original URLs query string to
be made part of the URL for an external redirection. 
For <func>, you can add paths to be fixed using one of a number of built-in
fixing functions: 
PFprefix: If the prefix in the 'from' arg is found, change it to match the
'to' arg. 
PFwhole:  If the prefix in the 'from' arg is found, change whole path to the
one in the 'to' arg. 
PFpath:   If the prefix in the 'from' arg is found, change the path up to
the filename to match the 'to' arg. 
PFfile:   If the path up to the filename in the 'from' arg is found, change
the file name to the file name in the 'to' arg. 
For each redirection, you need to indicate if it should be internal or
external. 
The optional argument, <tag>, can be used to provide a set of query string
name/values to be put at the end of an external redirection. 

The optional argument, 'disableQueryString', can be set if you do not want
the original URLs query string to be made part of the URL for an external
redirection. 

All arguments are case sensitive, so be careful when typing 'internal',
'external' and 'disableQueryString'. 

Here is an example for PFAddPath: 

PFAddPath /0,1,,00.html /fdoor PFpath internal
internally redirects to /fdoor/0,1,,00.html if the original request is
/0,1,,00.html. 
PFAddPath must be called for every prefix that needs transform. So there
could be 0 to many calls of PFAddPath in httpd.conf.




mod-setnote:
mod_setnote is a new Apache module that adds name value pairs (notes) to the
data kept by the the web server while it  processes an HTTP
 request (the request_rec) when attributes of the request contain certain
substrings. These attributes can be the values of various request header 
fields (see RFC2616 for more information about these), or of other aspects
of the request, including the following: 
     Remote_Host: the hostname (if available) of the client making the
request 
     Remote_Addr: the IP address of the client making the request 
     Remote_User: the authenticated username (if available) 
     Request_Method: the name of the method being used (GET, POST, etc.) 
     Request_Protocol: the name and version of the protocol with which the
request was made (e.g. "HTTP/1.1", etc.) 
     Request_URI: the portion of the URL following the scheme and host
portion 

Some of the more commonly used request header field names include Host,
Referer, and, the one we are most interested in, User Agent. 

mod_setnote's design is loosely based on that of mod_setenvif. 

mod_setnote does its work during the web server's "post read request" or
"parse header" stage, by way of its search_attribute_values handler. 

To do its work mod_setnote maintains a collection of records, each of which
contains the name of an HTTP request attribute, the set of substrings
mod_setnote 
should try to find in the attribute's value, and some tables needed by the
algorithm that mod_setnote uses to do the looking. Records may be added to
the 
collection, and substrings to the set of substrings associated with any
record already in the collection, using one of mod_setnote's four
directives: 
AttributeMatch, AttributeNoCase, AgentMatch, AgentMatchNoCase. 

mod_setnote uses the well-known Aho-Corasick string matching algorithm to
find the substrings in HTTP request attribute values. This algorithm's
performance is tied 
to the length of the attribute value being examined, rather than  the size
of P (the set of substrings to match against it).


Regards
Ian

--
Ian Holsman
Performance Measurement & Analysis
415-364-8608 

Mime
View raw message