此内容没有您所选择的语言版本。

2.5. Filesystem Paths


JBoss EAP 6 uses logical names for filesystem paths. The domain.xml, host.xml, and standalone.xml configuration files each include a section for declaring paths.
Other sections of each file can then reference the paths using their logical name, avoiding the need to use absolute paths for each instance and allowing specific host configurations to resolve to universal logical names.
The default logging subsystem configuration, for example, declares jboss.server.log.dir as the logical name for the server’s log directory.

Example 2.16. Relative path example for the logging directory

<file relative-to="jboss.server.log.dir" path="server.log"/>
Copy to Clipboard Toggle word wrap
JBoss EAP 6 automatically provides a number of standard paths without any need for the user to configure them in a configuration file.
Expand
Table 2.4. Standard Paths
Value Description
java.ext.dirs The Java development kit extension directory paths.
jboss.home.dir The root directory of the JBoss EAP 6 distribution.
user.home The user home directory.
user.dir The user's current working directory.
java.home The Java installation directory
jboss.server.base.dir The root directory for an individual server instance.
jboss.server.data.dir The directory the server will use for persistent data file storage.
jboss.server.config.dir The directory that contains the server configuration.
jboss.server.log.dir The directory the server will use for log file storage.
jboss.server.temp.dir The directory the server will use for temporary file storage.
jboss.server.deploy.dir The directory that the server will use for storing deployed content.
jboss.controller.temp.dir The directory the host controller will use for temporary file storage.
jboss.domain.base.dir The base directory for domain content.
jboss.domain.config.dir The directory that contains the domain configuration.
jboss.domain.data.dir The directory that the domain will use for persistent data file storage.
jboss.domain.log.dir The directory that the domain will use for persistent log file storage.
jboss.domain.temp.dir The directory that the domain will use for temporary file storage.
jboss.domain.deployment.dir The directory that the domain will use for storing deployed content.
jboss.domain.servers.dir The directory that the domain will use for storing outputs of the managed domain instances.
Override a Path

If you are running a standalone server, you can override all the jboss.server.* paths in one of the two ways.

  • You can pass command line arguments when you start the server. For example:
    bin/standalone.sh -Djboss.server.log.dir=/var/log
    Copy to Clipboard Toggle word wrap
  • You can modify the JAVA_OPTS variable in the server configuration file. Open the EAP_HOME/bin/standalone.conf file and add the following line at the end of the file:
    JAVA_OPTS="$JAVA_OPTS -Djboss.server.log.dir=/var/log"
    Copy to Clipboard Toggle word wrap
Path overrides is supported for servers running in a managed domain. For example, the jboss.domain.servers.dir can be used to change the base directories of servers in a managed domain.
Add a Custom Path

You can also create your own custom path. For example, you may want to define a relative path to use for logging. You can then change the log handler to use my.relative.path,

Example 2.17. A custom logging path

my.relative.path=/var/log
Copy to Clipboard Toggle word wrap

2.5.1. Directory Grouping

In domain mode, each server's files are stored in the EAP_HOME/domain/ directory. Subdirectories are named according to the directory-grouping attribute, either by server or file type.
Directory Grouping by Server

The default directory grouping is by server. If your administration is server-centric, this configuration is recommended. For example, it allows backups and log file handling to be configured per server instance.

Example 2.18.  Directory Grouping by Server

If JBoss EAP is installed using the Zip method and all default options apply, the directory structure in domain mode will be as follows.
EAP_HOME/domain
             └─ servers
                  ├── server-one
                  │   ├── data
                  │   ├── tmp
                  │   └── log
                  └── server-two
                      ├── data
                      ├── tmp
                      └── log
Copy to Clipboard Toggle word wrap
If the directory-grouping attribute has been changed from the default, and you want to reset it, enter the following management CLI command.
/host=master:write-attribute(name="directory-grouping",value="by-server")
Copy to Clipboard Toggle word wrap
This will update the controller's host.xml configuration file:
<servers directory-grouping="by-server">
  <server name="server-one" group="main-server-group" >
  </server>
  <server name="server-two" group="main-server-group" auto-start="true">
  </server>
</servers>
Copy to Clipboard Toggle word wrap
Directory Grouping by Type

Instead of grouping each servers' directories by server, you can instead group them by file type. If your administration is file type-centric, this configuration is recommended. For example, backup configuration is simpler if you want to include only data files.

To group domain data directories by type, enter the following management CLI command:
/host=master:write-attribute(name="directory-grouping",value="by-type")
Copy to Clipboard Toggle word wrap
This will update the controller's host.xml configuration file:
<servers directory-grouping="by-type">
  <server name="server-one" group="main-server-group" >
  </server>
  <server name="server-two" group="main-server-group" auto-start="true">
  </server>
</servers>
Copy to Clipboard Toggle word wrap

Example 2.19.  Directory Grouping by Type

If JBoss EAP is installed using the Zip method and the domain's files are grouped by type, the directory structure in domain mode will be as follows.
EAP_HOME/domain
            ├── data
            │   └── servers
            │       ├── server-one
            │       └── server-two
            ├── log
            │   └── servers
            │       ├── server-one
            │       └── server-two
            └── tmp
                └── servers
                    ├── server-one
                    └── server-two
Copy to Clipboard Toggle word wrap

2.5.2. Use Case: Overriding Directories

In this example, the objective is to store domain files in the /opt/jboss_eap/data/domain_data directory, and give each top-level directory a custom name. The directory grouping used is the default: by-server.
  • Log files stored in the subdirectory all_logs
  • Data files stored in the subdirectory all_data
  • Temporary files stored in the subdirectory all_temp
  • Servers' files stored in the subdirectory all_servers
To achieve this configuration, you would override several system properties when starting JBoss EAP.
./domain.sh \
      -Djboss.domain.temp.dir=/opt/jboss_eap/data/domain_data/all_temp \
      -Djboss.domain.log.dir=/opt/jboss_eap/data/domain_data/all_logs \
      -Djboss.domain.data.dir=/opt/jboss_eap/data/domain_data/all_data\
      -Djboss.domain.servers.dir=/opt/jboss_eap/data/domain_data/all_servers
Copy to Clipboard Toggle word wrap
The resulting path structure will be as follows:
/opt/jboss_eap/data/domain_data/
├── all_data
│   └── content
├── all_logs
│   ├── host-controller.log
│   └── process-controller.log
├── all_servers
│   ├── server-one
│   │   ├── data
│   │   │   ├── content
│   │   │   ├── logging.properties
│   │   ├── log
│   │   │   └── server.log
│   │   └── tmp
│   │       ├── vfs
│   │       │   └── temp
│   │       └── work
│   │           └── jboss.web
│   │               └── default-host
│   └── server-two
│       ├── data
│       │   ├── content
│       │   ├── logging.properties
│       ├── log
│       │   └── server.log
│       └── tmp
│           ├── vfs
│           │   └── temp
│           └── work
│               └── jboss.web
│                   └── default-host
└── all_temp
    └── auth
          ...
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat