Specify Liberty profile bootstrap properties
Bootstrap properties initialize the runtime environment for a particular server. Generally, they are attributes that affect 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 we create it. Create this file in the server directory, which also contains the configuration root file server.xml. By default, the server directory is usr/servers/server_name. We can change the server directory as described in Customize the Liberty profile environment.
The bootstrap.properties file contains two types of properties:
- A small, predefined set of initialization properties.
- Any custom properties we choose to define. We can then use these custom properties as variables in other configuration files such as server.xml and included files.
We can edit bootstrap.properties using a text editor or the editor in the WebSphere Application Server Developer Tools for Eclipse. See Edit the Liberty profile configuration using developer tools.
If you update bootstrap.properties, we must restart the server for the changes to take effect.
- Use predefined properties to configure trace and logging.
- To change the name of the trace file, set...
- To enable binary logging, set...
- Use predefined properties for OSGi framework diagnostics. For example, set the port for the OSGi console as follows:
- Use predefined properties for OSGi framework extensions. Specify the org.osgi.framework.bootdelegation property if this is required by external monitoring tools. The value is a comma-delimited list of packages.
- Use predefined properties for configuration password encryption.
- Use custom properties to define the default ports for web applications.
We can share server.xml and use XML configuration files across various development environments that allow machine- or environment-specific customization. For example:
- Properties default.http.port and default.https.port in bootstrap.properties:
default.http.port = 9081 default.https.port = 9444If we do not specify the properties, the default HTTP port is 9080 and HTTPS ports is 9443. To override the default HTTP endpoint definition, set the id attribute of the httpEndpoint element to defaultHttpEndpoint in the server configuration.
- Use the following properties in server.xml.
<httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="${default.http.port}" httpsPort="${default.https.port}" />host="*" means "listen on all adapters". By default, the server is listening only on address 127.0.0.1/localhost. We can also use the host property to specify a single IP address, and then the system listens only on the specified adapter.
Use custom properties to set the command port.
Set the command port to enable the server script to communicate with the running Liberty server and request certain operations, such as stopping the Liberty server or issuing a Java dump.
By default, the Liberty server acquires an ephemeral port to be used by the command listener. We can override the default behavior of the Liberty server using the command.port property.
-1 Command port is disabled. 0 Default. Ephemeral port is chosen at run time. 1-65535 User-specified port.
You are strongly discouraged from disabling the command port. If you disable the command port, we cannot use the server script to request some operations, for example, stopping the Liberty server or issuing a Java dump.
- To apply the changes, restart the server.
Parent topic: Set up the Liberty profileConcepts:
Server configuration Tasks:
Administer the Liberty profile using developer tools
Edit the Liberty profile configuration using developer tools
Displaying the server configuration in a merged view
Create a Liberty profile server using developer tools
Configure session persistenceReference:
Logging and Trace
Directory locations
Configuration elements in server.xml