Applicable in NameTrans-class directives.
The document-root function specifies the root document directory for the server. If the physical path has not been set by a previous NameTrans function, the http://server-name/ part of the path is replaced by the physical path name for the document root.
When the server receives a request for http://server-name/somepath/somefile, the document-root function replaces http://server-name/ with the value of its root parameter. For example, if the document root directory is /usr/sun/webserver61/server1/docs, then when the server receives a request for http://server-name/a/b/file.html, the document-root function translates the path name for the requested resource to /usr/sun/webserver61/server1/docs/a/b/file.html.
This function always returns REQ_PROCEED. NameTrans directives listed after this response are never called, so be sure that the directive that invokes document-root is the last NameTrans directive.
You can declare only one root document directory. To specify additional document directories, use the pfx2dir function to set up additional path name translations.
The following table describes parameters for the document-root function.
Table 5–42 document-root parameters
Parameter |
Description |
---|---|
File system path to the server’s root document directory |
|
bucket |
(Optional) Common to all obj.conf functions |
NameTrans fn=document-root root=/usr/sun/webserver61/server1/docsNameTrans fn=document-root root=$docroot |