Configuration file and resource management of wildfly 21


brief introduction

In the last article, we introduced the basic use and management interface of wildfly 21. Today, we will explain the configuration file and resource management of wildfly in detail.

Profile for wildfly

Whether in standalone or domain mode, it is very important to have two configuration files. They are standalone XML and domain xml。

Other standalone – * XML can refer to standalone. XML XML to configure

Let’s look at standalone General structure of XML:

<server xmlns="urn:jboss:domain:14.0">
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">

Server mainly has five parts: extensions, management, profile, interfaces and socket binding group.


Extensions represent modules outside the core application. With these external modules, the wildfly core application is very simple and lightweight.

These external modules are placed in the modules folder. We can refer to them by using the extension tag:

    <extension module=""/>
    <extension module="" />
    <extension module="" />
    <extension module="org.wildfly.extension.undertow"/>


A profile is composed of multiple subsystems. Subsystem is a set of new functions added to the core server through extension.

Let’s look at an example of profile and subsystem:

        <subsystem xmlns="urn:jboss:domain:logging:8.0">
            <console-handler name="CONSOLE">
                <level name="INFO"/>
                    <named-formatter name="COLOR-PATTERN"/>
            <periodic-rotating-file-handler name="FILE" autoflush="true">
                    <named-formatter name="PATTERN"/>
                <file relative-to="jboss.server.log.dir" path="server.log"/>
                <suffix value=".yyyy-MM-dd"/>
                <append value="true"/>
            <logger category="com.arjuna">
                <level name="WARN"/>
            <logger category="io.jaegertracing.Configuration">
                <level name="WARN"/>
            <logger category="">
                <level name="DEBUG"/>
            <logger category="sun.rmi">
                <level name="WARN"/>
                <level name="INFO"/>
                    <handler name="CONSOLE"/>
                    <handler name="FILE"/>
            <formatter name="PATTERN">
                <pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
            <formatter name="COLOR-PATTERN">
                <pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>

The above code configures a JBoss: domain: logging, and sets the log format, log level and other information.

Basically domain XML and standalone The content of the profile in XML is the same, but the difference is domain Multiple profiles can be configured in XML, while standalone. XML XML can only have one profile.


In the above log configuration, we used the path attribute of file in periodic rotating file handler. You need to specify the location of the log file in the path attribute.

<file relative-to="jboss.server.log.dir" path="server.log"/>

Here we use server Log, in fact, there are many built-in path variables in wildfly:

  • jboss. home. Dir – the root directory of wildfly
  • user. Home – user’s home directory
  • user. Dir – the user’s current working directory
  • java. Home – Java installation directory
  • jboss. server. base. Dir – the root directory of the server instance
  • jboss. server. config. Dir – configuration file directory of the server instance
  • jboss. server. data. Dir – data directory of the server instance
  • jboss. server. log. Dir – log directory of the server instance
  • jboss. server. temp. Dir – temp directory of the server instance
  • jboss. controller. temp. Dir – temp directory of controller instance
  • jboss. domain. servers. Dir – the working directory created by host controller for servers in managed domain mode

In addition to the top five paths, users can customize or rewrite other built-in paths:

<path name="example" path="example" relative-to=""/>

Where name refers to the name of path, and path is the value of path. If there is no relative to, it is an absolute path, and if there is no relative to, it is a relative path.

Relative to represents the benchmark of the relative path.

The above format can only be in standalone Used in XML files. If you want to be in domain XML, you must use the following format:

<path name="x"/>

The name here is only for host A reference to the path definition in the XML file:

<path name="x" path="/var/x" />


Iterface represents a network interface, which can be either a hostname or an IP address. It is used for the subsequent sockets binding.

Let’s take an example of an interface:

        <interface name="management">
            <inet-address value="${}"/>
        <interface name="public">
            <inet-address value="${jboss.bind.address:}"/>

Similarly, if it is in domain The interface tag in XML can only contain the name attribute:

<interface name="internal"/>

This reference is defined in host XML.


Socket binding defines the network exit. By specifying the bound IP and interface, you can finally access the corresponding services through this address:

    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
        <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
        <socket-binding name="http" port="${jboss.http.port:8080}"/>
        <socket-binding name="https" port="${jboss.https.port:8443}"/>
        <socket-binding name="management-http" interface="management" port="${}"/>
        <socket-binding name="management-https" interface="management" port="${}"/>
        <socket-binding name="txn-recovery-environment" port="4712"/>
        <socket-binding name="txn-status-manager" port="4713"/>
        <outbound-socket-binding name="mail-smtp">
            <remote-destination host="${}" port="${jboss.mail.server.port:25}"/>

In the above example, we have defined the addresses of AJP, HTTP and HTTPS, as well as several management side, transaction and mail addresses.

Note that we have a property called port offset, which can set the offset of the standard interface, especially when the standard interface is occupied.

For example, our default HTTP port is 8080. If this port is already occupied, we can pass in a port offset = 100, so that the HTTP port becomes 8180, which is very convenient.


Management is the configuration of the wildfly management end. We know that the management of wildfly can be carried out through the web end or cli end of wildfly.

Let’s look at the definition of management:

            <security-realm name="ManagementRealm">
                    <local default-user="$local" skip-group-loading="true"/>
                    <properties path="" relative-to="jboss.server.config.dir"/>
                <authorization map-groups-to-roles="false">
                    <properties path="" relative-to="jboss.server.config.dir"/>
                <json-formatter name="json-formatter"/>
                <file-handler name="file" formatter="json-formatter" path="audit-log.log" relative-to=""/>
            <logger log-boot="true" log-read-only="false" enabled="false">
                    <handler name="file"/>
            <http-interface security-realm="ManagementRealm">
                <http-upgrade enabled="true"/>
                <socket-binding http="management-http"/>
        <access-control provider="simple">
                <role name="SuperUser">
                        <user name="$local"/>

In the above example, we specify the access address of the management side and the security policy to be used through management interfaces.

In security realms, we can define a variety of security realms. User information and group information can be defined in security realm.

resource management

Wildfly provides two ways of resource management, one is through the webhttp://host: 9990 / console, one is through the command line:

You are disconnected at the moment. Type 'connect' to connect to the server
or 'help' for the list of supported commands.
[disconnected /]
[disconnected /] connect
[[email protected]:9990 /]

Everyone on the web side should know how to use it. Here we focus on the use of the command line side.

We can get the commands that can be executed on the command line through help — commands:

attachment                              deployment enable-all                   module                                  security enable-http-auth-http-server
batch                                   deployment info                         patch apply                             security enable-http-auth-management
cd                                      deployment list                         patch history                           security enable-sasl-management
clear                                   deployment undeploy                     patch info                              security enable-ssl-http-server
command                                 deployment undeploy-cli-archive         patch inspect                           security enable-ssl-management
command-timeout                         deployment-info                         pwd                                     security reorder-sasl-management
connect                                 deployment-overlay                      quit                                    set
connection-info                         echo                                    read-attribute                          shutdown
data-source                             echo-dmr                                read-operation                          try
deploy                                  for                                     reload                                  undeploy
deployment deploy-cli-archive           grep                                    run-batch                               unset
deployment deploy-file                  help                                    security disable-http-auth-http-server  version
deployment deploy-url                   history                                 security disable-http-auth-management   xa-data-source
deployment disable                      if                                      security disable-sasl-management
deployment disable-all                  jdbc-driver-info                        security disable-ssl-http-server
deployment enable                       ls                                      security disable-ssl-management

In addition, the command line also provides a series of operators for resources to operate on resources.

In wildfly, manageable objects are regarded as resources one by one. We can access this resource through the path of the resource.

For example, I’d like to take a look at the resource named default server, which can be as follows:


Resource paths can be concatenated, for example:


These are valid resource paths.

With the resource path, we also need to provide operators to operate resources. Wildfly provides the following operators:













We can use operators by prefixing them with colons:


The above example will get the operators for the logging subsystem:

    "outcome" => "success",
    "result" => [


This article explains the operations related to the configuration file and resource management of wildfly. I hope you can like it.

Author: what about the flybean program

Link to this article:

Source of this article: flybean’s blog

Welcome to my official account: the most popular interpretation of “those things”, the most profound dry cargo, the most concise tutorial, and many small tricks you don’t know, etc. you’ll find them!