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" [ <!ELEMENT LS (DESCRIPTION?,SSLPARAMS?)> <!ATTLIST LS id ID #REQUIRED ip CDATA "any" port CDATA #REQUIRED security %boolean; "false" acceptorthreads CDATA "1" family CDATA #IMPLIED blocking %boolean; "false" servername CDATA #REQUIRED >
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.
Variable substitution is allowed only in an obj.conf file. It is not allowed in any other Sun Java System Web Proxy Server configuration files. Any variable referenced in an obj.conf file must be defined in the server.xml file.