Customizing the Liberty environment

You can customize the Liberty environment by using certain specific variables to support the placement of product binary files and shared resources in read-only file systems.

About this task

The Liberty specific environment variables in the following list can be configured in the server.env file to customize the Liberty environment. The ${wlp.install.dir} configuration variable has an inferred location that is always set to the parent of the directory that contains the launch script.

  • WLP_USER_DIR

    This environment variable can be used to specify an alternative location for ${wlp.user.dir}. This variable must be an absolute path. If this variable is specified, the runtime environment looks for shared resources and server definitions in the specified directory. The ${server.config.dir} is equivalent to ${wlp.user.dir}/servers/serverName. If this environment variable is not specified, ${wlp.user.dir} is set to ${wlp.install.dir}/usr.

  • WLP_OUTPUT_DIR

    This environment variable can be used to specify an alternative location for server generated output such as logs, the workarea directory, and generated files. Files in the logs directory can include console.log, messages.log, and any generated FFDC files. Generated files can include server dumps that are created with the server dump or server javadump command. This variable must be an absolute path. If this environment variable is specified, ${server.output.dir} is set to the equivalent of WLP_OUTPUT_DIR/serverName. If this environment variable is not specified, ${server.output.dir} is the same as ${server.config.dir}.

    When the server command is used, the server process uses the output directory as its current working directory.

  • WLP_DEBUG_ADDRESS

    This environment variable can be used to specify an alternative port when you run the server in debug mode. The default value is 7777. When Liberty is run in debug mode from the server command, the following values are set JAVA_DEBUG="-Dwas.debug.mode=true -Dcom.ibm.websphere.ras.inject.at.transform=true -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=${WLP_DEBUG_ADDRESS}". If however, you run Liberty from the ws-server.jar executable JAR file, or the embedded Liberty server SPI, then you must use the same settings to enable debug mode for Liberty.

You can specify WLP_OUTPUT_DIR, WLP_USER_DIR, and WLP_DEBUG_ADDRESS environment variables in server.env files. You can also specify JVM options in jvm.options files. Both server.env and jvm.options files work only when you use the server management script. If you use the ws-server.jar executable JAR file to launch your server, these files are not supported.

Procedure

What to do next

If you start the Liberty server by using the server script, all of the operating system environment variables from the current session are available. If you start the server by using either the MBean or the Admin Center, the only available environment variables are those variables that are available to a remote command that is running on that system.


Icon that indicates the type of topic Task topic



Timestamp icon Last updated: Monday, 5 December 2016
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-libcore-mp&topic=twlp_admin_customvars
File name: twlp_admin_customvars.html