Sun Java System Web Server 6.1 SP11 Administrator's Configuration File Reference


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 will never be called, so be sure that the directive that invokes document-root is the last NameTrans directive.

There can be 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 4–10 document-root Parameters




File system path to the server’s root document directory. 


(Optional) Common to all obj.conf functions.


NameTrans fn=document-root root=/usr/sun/webserver61/server1/docs

NameTrans fn=document-root root=$docroot

See Also