Flow of Control in obj.conf
36
Netscape Enterprise Server NSAPI Programmer’s Guide • April 2002 (Draft)
The
NameTrans
section in the default object must contain exactly one directive that
invokes the
document-root
function. This functions translates the
http://
server_name
/
part of the requested URL to a physical directory that has
been designated as the server’s document root. For example:
NameTrans fn="document-root" root="D:/Netscape/Servers/docs"
The directive that invokes
document-root
must be the last directive in the
NameTrans
section so that it is executed if no other
NameTrans
directive is
applicable.
The
pfx2dir
(prefix to directory) function is used to set up additional mappings
between URLs and directories. For example, the following directive translates the
URL
http://
server_name
/cgi/
into the directory pathname
D:/netscape/servers/docs/mycgi/
:
NameTrans fn="pfx2dir" from="/cgi"
dir="D:/netscape/servers/docs/mycgi"
Notice that if this directive appeared after the one that calls
document-root
, it
would never be executed, with the result that the resultant directory pathname
would be
D:/netscape/servers/docs/cgi/
(not
mycgi
). This illustrates why the
directive that invokes
document-root
must be the last one in the
NameTrans
section.
How the Server Knows to Process Other Objects
As a result of executing a
NameTrans
directive, the server might start processing
directives in another object. This happens if the
NameTrans
directive that was
successfully executed specifies a name or generates a partial path that matches the
name
or
ppath
attribute of another object.
If the successful
NameTrans
directive assigns a name by specifying a
name
argument, the server starts processing directives in the named object (defined with
the
OBJECT
tag) before processing directives in the default object for the rest of the
request handling process.
For example, the following
NameTrans
directive in the default object assigns the
name
cgi
to any request whose URL starts with
http://
server_name
/cgi/
.
<Object name="default">
...
NameTrans fn="pfx2dir" from="/cgi"
dir="D:/netscape/servers/docs/mycgi" name="cgi"
...
</Object>
Summary of Contents for ENTERPRISE SERVER 6.1
Page 1: ...NSAPI Programmer s Guide Netscape Enterprise Server Version6 1 April 2002 Draft...
Page 290: ...Miscellaneous 290 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Page 318: ...cinfo 318 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Page 336: ...Buffered Streams 336 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Page 344: ...344 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Page 350: ...350 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Page 356: ...356 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...