Manage substitution variables with the administrative console
In WebSphere Application Server - Express, you can use substitution variables to represent values in configuration files. For example, the variable LOG_ROOT represents the value /QIBM/UserData/WebASE51/ASE/instance/logs, where instance is the name of your instance. To change the location of the log files for your instance, change the value of the LOG_ROOT variable to the new path.
You can define variables for the cell, node, and server scopes. A variable applies to all configuration files in the scope for which it is defined. For example, WebSphere Application Server - Express defines the APP_INSTALL_ROOT variable for the node scope. The value defined for the node applies to all application servers within that node. If variables in multiple scopes have the same name, the variable with the narrowest scope takes precedence. For example, if you have two application servers, called myServer1 and myServer2, you can define APP_INSTALL_ROOT at the server level for each application server. If you define a separate APP_INSTALL_ROOT variable for myserver1, but not for myServer2, this is how WebSphere Application Server resolves the values:
- For myServer1, configuration files use the value defined for the server scope.
- For myServer2, APP_INSTALL_ROOT is not defined for the server scope. As a result, configuration files for myServer2 use the value defined for the node scope.
You can also use WebSphere variables to modify the daemon configuration. To designate a variable specifically for a daemon, append a server custom property onto a daemon tag. Specify DAEMON_server_custom_property in the Name field. For example, if you specify DAEMON_ras_trace_outputlocation in the Name field and SYSOUT in the Value field, that daemon's trace output is directed to SYSPRINT.
WebSphere variables support substitution. You can use a variable name as part of the value of another variable. For example, if you specify ${variable_name} in the Name field, the value of variable_name is the name of the new variable. For example ${JAVA_HOME} creates a WebSphere variable with a name that is equal to the Java home directory.
WebSphere Application Server uses internal variables. The application server uses these variables for its own purposes. The prefixes for internal variables are WAS_DAEMON_server custom property, WAS_DAEMON_ONLY_server custom property, and WAS_SERVER_ONLY_server custom property. Variables that include these prefixes are reserved for use by the server runtime. Do not modify these variables.
For instructions on adminstering substitution variables, see these sections:
To add a new substitution variable, follow these steps:
- Start the WebSphere administrative console.
- In the topology tree, expand Environment and click Manage WebSphere Variables.
- On the WebSphere Variables page, specify the scope for which you want to define the variable and click Apply.
- Click New.
- Specify a name and value for the variable.
- Click OK.
- Save the configuration.
To modify a substitution variable, follow these steps:
- Start the WebSphere administrative console.
- In the topology tree, expand Environment and click Manage WebSphere Variables.
- On the WebSphere Variables page, specify the scope that contains the variable that you want to modify and click Apply.
- Click the name of the variable that you want to modify.
- Make your changes.
- Click OK.
- Save the configuration.
To remove a substitution variable, follow these steps:
- Start the WebSphere administrative console.
- In the topology tree, expand Environment and click Manage WebSphere Variables.
- On the WebSphere Variables page, specify the scope that contains the variable that you want to remove and click Apply.
- Select the checkbox for the variable that you want to remove.
- Click Delete.
- Save the configuration.
You can also use wsadmin to manage substitution variables for your appliation server instance. See Use wsadmin to manage substitution variables for information.