Open Liberty bootstrap properties
Bootstrap properties initialize the runtime environment for a particular server. You can set these properties to customize the configuration and initialization of the runtime core.
Bootstrap properties are set in a text file named bootstrap.properties
. This file is not required, so it does not exist unless you create it. You must create this file in the server configuration directory, which also contains the server.xml
file. By default, the server directory is usr/servers/server_name
.
If you update the bootstrap.properties
file, you must restart the server for the changes to take effect. However, when Open Liberty is running in dev mode, it automatically detects changes to the bootstrap.properties
file and restarts the server to apply them.
You can use the bootstrap.properties
file to define two types of properties.
A small, predefined set of initialization properties.
Any custom properties that you choose to define. You can use these custom properties as variables in other configuration files such as
server.xml
and included files.
Configure trace and logging
To change the name of your trace file, specify the com.ibm.ws.logging.trace.file.name
property with a file name of your choice, as shown in the following example.
com.ibm.ws.logging.trace.file.name = trace.log
To enable binary logging, specify the websphere.log.provider
property as shown in the following example.
websphere.log.provider = binaryLogging-1.0
Define the default ports for web applications
You can define custom variables in the bootstrap.properties
file that specify custom default values for HTTP and HTTPS ports. These values are applied to any HTTP Endpoint configuration that specifies the variables in the server.xml
file.
The default value for the HTTP port is 9080
and the default value for the HTTPS port is 9443
. You can create custom defaults to replace these values by specifying the default.http.port
and default.https.port
properties in the bootstrap.properties
file, as shown in the following example.
default.http.port = 9081 default.https.port = 9444
After you define these properties in the bootstrap.properties
file, you can use them as variables to define the port values for your HTTP endpoint configuration in the server.xml
file, as shown in the following example.
<httpEndpoint id="defaultHttpEndpoint"
httpPort="${default.http.port}"
httpsPort="${default.https.port}" />
For more information about how variables are applied in the server configuration, see Variable substitution precedence.
Set the command port
The command port enables the server script to communicate with the running Open Liberty server and request certain operations, such as stopping the Open Liberty server or issuing a Java dump. For security, the command port cannot be accessed remotely, and clients must have read/write access to the server output directory to be authorized to issue commands.
By default, the Open Liberty server acquires an ephemeral port to be used by the command listener at run time. You can override the default behavior of the Open Liberty server by using the command.port
property. The default value for the command.port
is 0
.
You can set the command.port
property in the bootstrap.properties
file, as shown in the following example.
command.port = 65535
The valid range of user-specified values for the command.port
is 1
to 65535
.
You can disable the command port by setting the command.port
property to -1
. However, this setting is not recommended. If you disable the command port, you cannot use the server script to request some operations, for example, stopping the Open Liberty server or issuing a Java dump.
Configure server start wait time
The server.start.wait.time
property defines how much time the start process can wait for the initiation of the main server process. The server.start.wait.time
property is specified in seconds. The default server start wait time is internally set to 30
seconds.
You can increase the server start wait time beyond the product default setting by specifying the server.start.wait.time
property to the boostrap.properties
file.
The following example sets the server start time to 35
seconds.
server.start.wait.time = 35
This property does not apply when the server is started with the server run
command.
Configure OSGi framework diagnostics and extensions
You can set the port for the OSGi console as shown in the following example.
osgi.console = 5678
Specify the org.osgi.framework.bootdelegation
property in the boostrap.properties
file if this property is required by external monitoring tools. The value is a comma-delimited list of packages.