You can use the Server Config tool to view and edit server configuration files in the Liberty topology. The Server Config tool displays
configuration files such as a server.xml file in two modes. The Design mode
displays the content of configuration files using graphical controls with inline documentation. The
Source mode provides direct access to the file text and has content assist capabilities. You can
customize the modes, for example, to add or remove parameter descriptions on the Design mode or to
add or remove line numbers on the Source mode. Before you can edit files, you must add a
remoteFileAccess
element to the server configuration file; otherwise, files are
shown in read-only mode.
In version 21.0.0.4 and
later, see the Open Liberty website for Admin Center documentation.
About this task
You can view and edit configuration files for Liberty servers that use the
adminCenter-1.0
feature and for Liberty collective members that are not in Docker
containers. You cannot view and edit configuration files for Liberty collective members in Docker containers
or for Node.js collective members.
Watch: The Getting
started with the Server Configuration Tool for WebSphere Liberty video shows how to enable
and use the tool.
Attention: To save changes to server configuration files in Admin Center, the user must
be in the administrator role.
Procedure
-
Enable editing of files in the server configuration directory.
-
Open an editor on the server configuration file.
The configuration file for a server typically has a path name such as
wlp/usr/servers/server_name/server.xml.
-
Add the following
remoteFileAccess
element to the server configuration
file.
<remoteFileAccess>
<writeDir>${server.config.dir}</writeDir>
</remoteFileAccess>
-
Save the file changes.
To edit server configuration files for a collective, there are additional steps you must
complete, especially for collective members. Not completing the additional steps can result in error
messages.
Note: Starting with 8.5.5.9, some errors are shown in the Server Config tool.
If you are running an earlier version of
Liberty or if the error is not descriptive, look
in the network tab of the browser debugger to see what went wrong. For information on specific
errors, see
Admin Center troubleshooting.
- Ensure that the PATH environment setting for the Java installation is correct. To avoid a
Java not found problem, complete one of the following steps:
- Specify the --hostJavaHome parameter in a collective
updateHost command.
- To complete step b at the same time, also specify
the --hostWritePath parameter. For
example:
wlp/bin/collective updateHost memberHost --host=collectiveHost --port=controllerHTTPSPort
--user=controllerAdmin --password=controllerAdminPassword --hostWritePath=/liberty/wlp/usr/servers --hostJavaHome=/opt/ibm/java-i386-70
- Create a link to Java in /usr/bin.
- For example:
/usr/bin/java -> /opt/ibm/java-i386-70/jre/bin/java
- Add Java to the PATH environment variable
- For more information, see Setting the JAVA_HOME
variable for Liberty collective members and controllers.
Export the PATH
in .bashrc
.
Create a JAVA_HOME
environment variable that points to the Java folder. Add %JAVA_HOME%/bin to the
PATH variable, using a semicolon as a separator.
- Set
hostWritePath
on the controller to enable it to access the
member configuration files. Run the collective updateHost command with the
--hostWritePath parameter:
wlp/bin/collective updateHost memberHost --host=collectiveHost --port=controllerHTTPSPort
--user=controllerAdmin --password=controllerAdminPassword --rpcUser=osUser --rpcUserPassword=osUserPassword
--hostReadPath=serversPath --hostWritePath=serversPath
After you enable editing, server configuration files such as the server.xml
and any included files no longer are read-only in the Server Config tool. You can change element and
parameter settings, and otherwise edit the files.
-
View or edit a configuration file in the Server Config tool.
-
From the Toolbox, select Server Config .
-
If Admin Center is run on a collective controller,
select the server that has the configuration file you want to view or edit.
-
After a file is open for editing, you can switch between Design and
Source modes.
In the Design mode, select elements in the configuration to see enabled features and parameter
settings.
In the Source mode, hover on elements and parameters to view their documentation. You can press
Ctrl+Space to use content assist, which helps you add new elements, parameters, and values.
- After you finish working with a file, select Save to save the
file changes and then Close to return to the main page of the tool. To
discard file changes, select Close and then confirm to not save the
changes.
- Optional:
Customize the default settings for Design or Source mode.
By default, the Design mode uses enhanced labels for file elements. Enhanced labels display
element names such as featureManager
as Feature Manager
. Also, the
Design mode displays parameter descriptions by default. The Source mode displays line numbers by
default. To change a default setting:
-
Select Settings .
-
Enable or disable one or more default settings.
-
Select Close.
What to do next
To return to the Toolbox, select Toolbox .