Chapter 2. Archive installation of JBoss EAP

You can use the archive installer to install, configure, and uninstall a JBoss EAP instance. You can use the archive installation on all platforms supported by JBoss EAP.

2.1. Downloading JBoss EAP archive

You can use the JBoss EAP archive file on the Red Hat Customer Portal to install JBoss EAP. The archive file installation is platform-independent.

Prerequisites

Procedure

  1. Log in to the Red Hat Customer Portal.
  2. Click Downloads.
  3. Select Red Hat JBoss Enterprise Application Platform in the Product Downloads list.
  4. In the Version drop-down list, select 7.4.
  5. Find Red Hat JBoss Enterprise Application Platform 7.4.0 in the list and click the Download link.

2.2. Installing JBoss EAP by using the archive

You can use the archive installation method to install JBoss EAP. This method is the simplest way to install JBoss EAP and the method provides a basic default installation of a server, with configuration files and libraries placed in standard folders.

Prerequisites

  • Set up an account on the Red Hat Customer Portal.
  • Review the JBoss EAP 7 supported configurations and ensure that your system is supported.
  • Download the JBoss EAP installation package.
  • Install a supported Java Development Kit (JDK).
  • If you are using Windows, set the JAVA_HOME and PATH environment variables. If you do not have this set up, shortcuts do not work.

Procedure

  1. Log in to the Red Hat Customer Portal.
  2. Click Downloads.
  3. Select Red Hat JBoss Enterprise Application Platform in the Product Downloads list.
  4. From the Version drop-down list, select 7.4
  5. Find Red Hat JBoss Enterprise Application Platform 7.4.0 in the list and select the Download link.
  6. Optional: Move the archive file to the server and location where you want to install JBoss EAP.

    Note

    You must have read and write access to this directory.

  7. Depending on your operating system, choose one of the following options:

    • For Red Hat Enterprise Linux, extract the archive file by entering the following command in the management CLI:

      $ unzip jboss-eap-7.4.0.zip
    • For Windows Server, right-click the archive file and select Extract All.
Note

EAP_HOME is the top-level directory for the JBoss EAP installation. The directory is created by extracting the archive.

Additional resources

  • See Setting up the EAP_HOME variable in the JBoss EAP Installation Guide.
  • For more information about authentication and authorization options, see Management Users in the JBoss EAP Configuration Guide.

2.3. JBoss EAP configuration file

You can configure options provided in the configuration file by uncommenting and editing the respective lines. If you do not edit the configuration file, the service defaults to starting a standalone JBoss EAP server using the default configuration file, standalone.xml.

The startup script and an associated configuration file are located in the EAP_HOME/bin/init.d/ directory.

Note

Several configurable options exist in the jboss-eap.conf file. You must provide the correct values for JBOSS_HOME and the JBOSS_USER.

If you want to start JBoss EAP in a managed domain, add JBOSS_MODE=domain to jboss-eap.conf. For example, to specify custom domain configuration files, add JBOSS_DOMAIN_CONFIG=DOMAIN_CONFIG_FILE.xml and JBOSS_HOST_CONFIG=HOST_CONFIG_FILE.xml.

Note

By default, JBoss EAP uses domain.xml and host-master.xml as the domain configuration files.

2.4. Configuring JBoss EAP archive installation as a service on RHEL

You can configure the archive installation to run as a service in Red Hat Enterprise Linux (RHEL).

Prerequisites

  • Install JBoss EAP as an archive installation.
  • Ensure that you administrator privileges on the server.

Procedure

  1. Configure the start-up options in the jboss-eap.conf file by opening the jboss-eap.conf in a text editor and set the options for your JBoss EAP installation.
  2. Copy the service initialization and configuration files into the system directories:

    1. Copy the modified service configuration file to the /etc/default directory.

      $ sudo cp EAP_HOME/bin/init.d/jboss-eap.conf /etc/default
    2. Copy the service startup script to the /etc/init.d directory and give it execute permissions:

      $ sudo cp EAP_HOME/bin/init.d/jboss-eap-rhel.sh /etc/init.d
      $ sudo chmod +x /etc/init.d/jboss-eap-rhel.sh
      $ sudo restorecon /etc/init.d/jboss-eap-rhel.sh
  3. Add the new jboss-eap-rhel.sh service to the list of automatically started services using the chkconfig service management command:

    $ sudo chkconfig --add jboss-eap-rhel.sh
  4. Verify that the service has been installed correctly by using one of the following commands.

    1. For Red Hat Enterprise Linux 6:

      $ sudo service jboss-eap-rhel.sh start
    2. For Red Hat Enterprise Linux 7 and 8:

      $ sudo service jboss-eap-rhel start

      The service starts. If the service does not start and you get an error message, check the error logs and make sure that the options in the configuration file are set correctly.

    3. For Red Hat Enterprise Linux 9:

      Note

      Red Hat Enterprise Linux 9 does not have the initscripts package in the default build. This package includes the /etc/init.d/functions file used by the jboss-eap-rhel.sh service. The /etc/init.d/functions file is required to start JBoss EAP as a service; therefore, install the initscripts package using the following command:

      $ sudo dnf install initscripts
      1. Restart systemctl:

        $ sudo systemctl daemon-reload
      2. Start JBoss EAP:

        $ sudo service jboss-eap-rhel start
  5. Optional: To make the service start automatically when the Red Hat Enterprise Linux server starts, run the following command:

    $ sudo chkconfig jboss-eap-rhel.sh on

Verification

  • To check the permissions of a file, enter the ls -l command in the directory containing the file.
  • To check that the automatic service start is enabled, enter the following command:

    $ sudo chkconfig --list jboss-eap-rhel.sh

Additional resources

  • For more information about controlling the state of services, see Management system services in the JBoss EAP Configuring basic system settings guide.
  • For more information about viewing error logs, see Bootup logging in the JBoss EAP Configuration Guide.

2.5. Removing JBoss EAP service on RHEL

Depending on your work environment, the archive installation method might not meet the needs of your environment. You can remove the instance of JBoss EAP and any services associated with it. Thereafter, you can install JBoss EAP using a suitable installation method.

Procedure

  1. If the service is running, open a terminal and stop the service with one of the following commands:

    1. For Red Hat Enterprise Linux 6:

      $ sudo service jboss-eap-rhel.sh stop
    2. For Red Hat Enterprise Linux 7 and later:

      $ sudo service jboss-eap-rhel stop
  2. Remove JBoss EAP from the list of services:

    $ sudo chkconfig --del jboss-eap-rhel.sh
  3. Delete the configuration file and startup script:

    $ sudo rm /etc/init.d/jboss-eap-rhel.sh
    $ sudo rm /etc/default/jboss-eap.conf

2.6. Installing JBoss EAP archive installation as a service on Microsoft Windows Server

You can install JBoss EAP on Microsoft Windows Server by using the archive installation method. This method provides a basic default installation of a server, with configuration files and libraries placed in standard folders. The default installation of the server contains a service.bat script that you can use with Jsvc to stop and start JBoss EAP.

Prerequisites

  • Ensure that you have administrator privileges on the server.
  • Set the JAVA_HOME system environment variable.

Procedure

  1. Install the JBoss EAP Core Services Jsvc package:

    1. Open a browser and log in to the Red Hat Customer Portal’s Software Downloads page.
    2. From the Product drop-down list, select Apache Jsvc.
    3. From the Version drop-down list, select the latest version.
    4. From the Releases list, select Red Hat JBoss Core Services Apache Jsvc. Ensure that you select the correct platform and architecture for your system. Next, select the Download link.
  2. Extract the downloaded archive file into the directory containing your JBoss EAP installation directory. This results in a jbcs-jsvc-<VERSION> directory at the same depth as your JBoss EAP installation directory. The following example shows the path to the jbcs-jsvc-<VERSION> directory:

    C:\Program Files
    ├── jboss-eap-7.4
    │   ├── bin
    │   └── ...
    └── jbcs-jsvc-<VERSION>
  3. Install the service by opening the terminal and changing the directories to EAP_HOME\bin. For a list of all possible options, run service.bat without any arguments

    Note

    If you specify the /jbossuser and /jbosspass parameters, you must ensure that your JBoss EAP user’s password does not contain a hash (#) or a semicolon (;).

    The following examples show a basic service.bat install command that is needed to create a new service for either a standalone server, or a server in a managed domain.

    Enter the following command, adjusting the log level for the service as required:

    1. For a standalone server:

      $ service.bat install /loglevel INFO
    2. For a server in a managed domain:

      Use the /host parameter to specify the name of the JBoss EAP host controller being controlled by the service. You can see valid values for the name by executing ls /host in the management CLI.

      In the following command, replace EAP_HOST_NAME with your JBoss EAP host controller name. If you specify the /host parameter without providing a JBoss EAP host controller name, the name defaults to master.

      $ service.bat install /host EAP_HOST_NAME /loglevel INFO
  4. A new Windows service is created with the name JBossEAP7.

Verification

  • Verify the new service in the Services console by opening the Windows Services console (services.msc) and checking that the service is created.

If the default service name was used, in the list of Windows services the new service is displayed as JBossEAP7.

Note

From the Services console you can start and stop the service, and change its settings of how and when it starts.

2.7. Configuring JBoss EAP archive installation as a service on Microsoft Windows Server

You can install JBoss EAP on Microsoft Windows Server using the archive installation method. This method provides a basic default installation of a server, with configuration files and libraries placed in standard folders.

Warning

If you use the set command to set system environment variables in a Windows Server command prompt, it does not permanently set the environment variables. You must use either the setx command, or the System interface in the Control Panel.

Prerequisites

  • Install JBoss EAP as an archive installation.
  • Ensure that you have administrator privileges on the server.
  • Set the JAVA_HOME system environment variable.
  • Verify that the JBoss EAP server instance is not running.

Procedure

  1. Use the setx command to create two system environment variables: JBOSS_HOME and NOPAUSE.
  2. Use the setx command to configure the two environment variables:

    1. Configure the path for the JBOSS_HOME variable to the JBoss EAP installation directory.
    2. The jboss-cli.bat script contains the if "x%NOPAUSE%" == "x" pause line of code. This code creates a status message when you issue the pause command. To disable these messages, you must specify a value for the NOPAUSE variable. For example, setting the NOPAUSE variable to NOPAUSE=true disables status messages from appearing when a script completes.

Additional resources

  • To learn more about how to set environment variables on a Microsoft Windows Server, refer to the Microsoft Windows documentation.

2.8. Starting and stopping the JBoss EAP service on Microsoft Windows Server

In certain situations, you might need to use the command prompt to either stop or start the service. For instance, if you make any registry changes, you must stop the service and then restart it to force the service to re-read the registry.

Prerequisites

  • Install JBoss EAP as an archive installation.

Procedure

  • To start the service, at the command prompt issue the following command:
$ net start JBossEAP7
  • To stop the service, at the command prompt issue the following command:
$ net stop JBossEAP7

2.9. Removing JBoss EAP service on Microsoft Windows Server

Depending on your work environment, the archive installation method might not meet the needs of your environment. You can remove the instance of JBoss EAP and any services associated with it. Thereafter, you can install JBoss EAP using a suitable installation method.

Procedure

  1. If the service is running, open the command prompt and stop the service by entering the net stop command with the name of the service:

    net stop JBossEAP7
  2. At a command prompt, change directories to EAP_HOME\bin and execute the following command:

    service.bat uninstall

2.10. Installing and starting JBoss EAP archive installation by using Jsvc

You can use the Apache Java Service (Jsvc) component of the JBoss Core Services Apache HTTP Server Installation Guide collection to run JBoss EAP as a detached process, daemon, on Red Hat Enterprise Linux (RHEL).

Note

Although Jsvc works on RHEL, we strongly recommend that you use the native methods for running JBoss EAP as a service on RHEL.

Jsvc is a set of libraries and applications that provide Java applications the ability to run as a background service. Applications run using Jsvc can perform operations as a privileged user, then switch identity to a non-privileged user.

Procedure

  1. Open a browser and log in to the Red Hat Customer Portal’s Software Downloads page.
  2. From the Product drop-down list, select Apache Jsvc.
  3. From the Version drop-down list, select the latest version.
  4. From the Releases list, select Red Hat JBoss Core Services Apache Jsvc. Ensure that you select the correct platform and architecture for your system. Next, select the Download link.
  5. Extract the downloaded archive file into the directory containing your JBoss EAP installation directory.

    This results in a jbcs-jsvc-<VERSION> directory at the same depth as your JBoss EAP installation directory. For example:

    /var/opt/
    ├── jboss-eap-7.4
    │   ├── bin
    │   └── ...
    └── jbcs-jsvc-<VERSION>
  6. Optional: The command examples for using Jsvc to start JBoss EAP assume that a jboss user has been created. If you have not already created a user for JBoss EAP, run the following commands to create the jboss user and group:

    # groupadd -f -g 185 -r jboss
    # useradd -r -u 185 -g jboss -d EAP_HOME -s /sbin/nologin -c "JBoss" jboss

Additional resources

2.11. Jsvc commands to start or stop JBoss EAP as a standalone server

Using Java Service (Jsvc), you can enter various commands for starting or stopping JBoss EAP. The following table shows a list of paths that are needed for the commands for an archive JBoss EAP installation.

Table 2.1. File Locations of Paths

File Reference in InstructionsFile Location

JSVC_BIN

EAP_HOME/../jbcs-jsvc-<VERSION>/sbin/jsvc

JSVC_JAR

EAP_HOME/../jbcs-jsvc-<VERSION>/lib/commons-daemon.jar

CONF_DIR

EAP_HOME/standalone/configuration

LOG_DIR

EAP_HOME/standalone/log

The following example demonstrates starting a standalone JBoss EAP server using Jsvc with a JSVC_BIN \ path:

$ JSVC_BIN \
 -outfile LOG_DIR/jsvc.out.log   \
 -errfile LOG_DIR/jsvc.err.log   \
 -pidfile LOG_DIR/jsvc.pid  \
 -user jboss \
 -D[Standalone] -XX:+UseCompressedOops -Xms1303m \
 -Xmx1303m -XX:MaxPermSize=256m \
 -Djava.net.preferIPv4Stack=true \
 -Djboss.modules.system.pkgs=org.jboss.byteman \
 -Djava.awt.headless=true \
 -Dorg.jboss.boot.log.file=LOG_DIR/server.log \
 -Dlogging.configuration=file:CONF_DIR/logging.properties \
 -Djboss.modules.policy-permissions \
 -cp EAP_HOME/jboss-modules.jar:JSVC_JAR \
 -Djboss.home.dir=EAP_HOME \
 -Djboss.server.base.dir=EAP_HOME/standalone   \
 @org.jboss.modules.Main -start-method main \
 -mp EAP_HOME/modules \
 -jaxpmodule javax.xml.jaxp-provider \
 org.jboss.as.standalone

The following example demonstrates stopping a standalone JBoss EAP server using Jsvc with a JSVC_BIN \ path:

$ JSVC_BIN \
 -stop \
 -outfile LOG_DIR/jsvc.out.log   \
 -errfile LOG_DIR/jsvc.err.log   \
 -pidfile LOG_DIR/jsvc.pid  \
 -user jboss \
 -D[Standalone] -XX:+UseCompressedOops -Xms1303m \
 -Xmx1303m -XX:MaxPermSize=256m \
 -Djava.net.preferIPv4Stack=true \
 -Djboss.modules.system.pkgs=org.jboss.byteman \
 -Djava.awt.headless=true \
 -Dorg.jboss.boot.log.file=LOG_DIR/server.log \
 -Dlogging.configuration=file:CONF_DIR/logging.properties \
 -Djboss.modules.policy-permissions \
 -cp EAP_HOME/jboss-modules.jar:JSVC_JAR \
 -Djboss.home.dir=EAP_HOME \
 -Djboss.server.base.dir=EAP_HOME/standalone   \
 @org.jboss.modules.Main -start-method main \
 -mp EAP_HOME/modules \
 -jaxpmodule javax.xml.jaxp-provider \
 org.jboss.as.standalone

2.12. Jsvc commands to start or stop JBoss EAP on a managed domain

Using Java Service (Jsvc), you can enter various commands for starting or stopping JBoss EAP. The following tables show the path that is needed for the commands for an archive JBoss EAP installation.

Table 2.2. File Locations of Paths

File Reference in InstructionsFile Location

JSVC_BIN

EAP_HOME/../jbcs-jsvc-<VERSION>/sbin/jsvc

JSVC_JAR

EAP_HOME/../jbcs-jsvc-<VERSION>/lib/commons-daemon.jar

CONF_DIR

EAP_HOME/domain/configuration

LOG_DIR

EAP_HOME/domain/log

Before you issue the following command, set the JAVA_HOME system environment variable.

The following example demonstrates starting a JBoss EAP managed domain using Jsvc:

$ JSVC_BIN \
 -outfile LOG_DIR/jsvc.out.log   \
 -errfile LOG_DIR/jsvc.err.log   \
 -pidfile LOG_DIR/jsvc.pid  \
 -user jboss \
 -nodetach -D"[Process Controller]" -server -Xms64m \
 -Xmx512m -XX:MaxPermSize=256m \
 -Djava.net.preferIPv4Stack=true  \
 -Djboss.modules.system.pkgs=org.jboss.byteman \
 -Djava.awt.headless=true  \
 -Dorg.jboss.boot.log.file=LOG_DIR/process-controller.log \
 -Dlogging.configuration=file:CONF_DIR/logging.properties \
 -Djboss.modules.policy-permissions \
 -cp "EAP_HOME/jboss-modules.jar:JSVC_JAR" \
 org.apache.commons.daemon.support.DaemonWrapper \
 -start org.jboss.modules.Main -start-method main \
 -mp EAP_HOME/modules org.jboss.as.process-controller \
 -jboss-home EAP_HOME -jvm "${JAVA_HOME}"/bin/java \
 -mp EAP_HOME/modules -- \
 -Dorg.jboss.boot.log.file=LOG_DIR/host-controller.log \
 -Dlogging.configuration=file:CONF_DIR/logging.properties \
 -Djboss.modules.policy-permissions \
 -server -Xms64m -Xmx512m -XX:MaxPermSize=256m \
 -Djava.net.preferIPv4Stack=true \
 -Djboss.modules.system.pkgs=org.jboss.byteman \
 -Djava.awt.headless=true -- -default-jvm "${JAVA_HOME}"/bin/java \

The following example demonstrates stopping a JBoss EAP managed domain using Jsvc:

$ JSVC_BIN \
 -stop \
 -outfile LOG_DIR/jsvc.out.log   \
 -errfile LOG_DIR/jsvc.err.log   \
 -pidfile LOG_DIR/jsvc.pid  \
 -user jboss \
 -nodetach -D"[Process Controller]" -server -Xms64m \
 -Xmx512m -XX:MaxPermSize=256m \
 -Djava.net.preferIPv4Stack=true  \
 -Djboss.modules.system.pkgs=org.jboss.byteman \
 -Djava.awt.headless=true  \
 -Dorg.jboss.boot.log.file=LOG_DIR/process-controller.log \
 -Dlogging.configuration=file:CONF_DIR/logging.properties \
 -Djboss.modules.policy-permissions \
 -cp "EAP_HOME/jboss-modules.jar:JSVC_JAR" \
 org.apache.commons.daemon.support.DaemonWrapper \
 -start org.jboss.modules.Main -start-method main \

2.13. Uninstalling a JBoss EAP archive installation

You can use the the archive installation method to install JBoss EAP in a single directory.

Depending on your work environment, the archive installation method might not meet the needs of your environment. You can remove the instance of JBoss EAP and any services associated with it. Thereafter, you can install JBoss EAP using a suitable installation method.

Prerequisites

  • Optional: Back up any modified configuration files and deployments that may be reused.

Procedure

  1. Delete the installation directory to uninstall JBoss EAP.
  2. Delete any scripts that depend on JBoss EAP being installed on your machine.