Editing server configuration files in Admin Center

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.

Open LibertyIn 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.

Multimedia 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

  1. Enable editing of files in the server configuration directory.
    1. 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.

    2. Add the following remoteFileAccess element to the server configuration file.
      <remoteFileAccess>
          <writeDir>${server.config.dir}</writeDir>
      </remoteFileAccess>
    3. 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.
    1. 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.

      For LINUX platformsExport the PATH in .bashrc.

      For Windows platformsCreate 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.

    2. 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.

  2. View or edit a configuration file in the Server Config tool.
    1. From the Toolbox, select Server Config Server Config icon.
    2. If Admin Center is run on a collective controller, select the server that has the configuration file you want to view or edit.
    3. 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.

    4. 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.
  3. 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:

    1. Select Settings Settings icon.
    2. Enable or disable one or more default settings.
    3. Select Close.
    Server Config tool open on a server.xml file in Design mode

What to do next

To return to the Toolbox, select Toolbox Toolbox icon.