2.5. Filesystem Paths
domain.xml
, host.xml
, and standalone.xml
configuration files each include a section for declaring paths.
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"/>
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. |
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
- You can modify the
JAVA_OPTS
variable in the server configuration file. Open theEAP_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"
jboss.domain.servers.dir
can be used to change the base directories of servers in a managed domain.
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
2.5.1. Directory Grouping
EAP_HOME/domain/
directory. Subdirectories are named according to the directory-grouping
attribute, either by server or file type.
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
EAP_HOME/domain └─ servers ├── server-one │ ├── data │ ├── tmp │ └── log └── server-two ├── data ├── tmp └── log
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")
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>
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.
/host=master:write-attribute(name="directory-grouping",value="by-type")
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>
Example 2.19. Directory Grouping by Type
EAP_HOME/domain ├── data │ └── servers │ ├── server-one │ └── server-two ├── log │ └── servers │ ├── server-one │ └── server-two └── tmp └── servers ├── server-one └── server-two
2.5.2. Use Case: Overriding Directories
/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
./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
/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 ...