Sun Java System Web Server 6.1 SP6 NSAPI Programmer's Guide

Variables Defined in server.xml

You can define variables in the server.xml file and reference them in an obj.conf file. For example, the following server.xml code defines and uses a variable called docroot:

<!DOCTYPE SERVER SYSTEM "server.dtd" [
    docroot CDATA #IMPLIED
        <VS id="" connections="ls1" urlhosts=""
                 mime="mime1" aclids="std">
            <property name=”docroot” value=”/opt/SUNWwbsvr/docs”/>

You can reference the variable in obj.conf as follows:

NameTrans fn=document-root root="$docroot"

Using this docroot variable saves you from having to define document roots for virtual server classes in the obj.conf files. It also allows you to define different document roots for different virtual servers within the same virtual server class.

Note –

Variable substitution is allowed only in an obj.conf file. It is not allowed in any other Sun Java System Web Server configuration files. Any variable referenced in an obj.conf file must be defined in the server.xml file.

For more information about defining variables, see the Sun Java System Web Server 6.1 SP6 Administrator’s Configuration File Reference.