4.7.3. Configure JBoss EAP 6 as a Service in Microsoft Windows Server (Zip, Installer)

Prerequisites

Summary

Use the following procedures to configure JBoss EAP 6 as a service on Microsoft Windows Server.

Procedure 4.13. Configure a Service for JBoss EAP 6 in Microsoft Windows Server

  1. Create system environment variables

    Create two system environment variables:
    • JBOSS_HOME pointing to the JBoss EAP 6 installation directory.
    • NOPAUSE=1
  2. If not already configured, download and extract the Native Utilities package for your architecture

    If the Native Utilities for Windows Server package has not been installed as part of the JBoss EAP 6 installation, download the relevant 32-bit or 64-bit package from the Red Hat Customer Portal at https://access.redhat.com. Extract the Native Utilities zip archive over the JBoss EAP 6 installation.
    This will result in a native directory in the following location in the JBoss EAP 6 installation: EAP_HOME\modules\system\layers\base\
  3. Install the service

    Open a terminal, and change directories to EAP_HOME\modules\system\layers\base\native\sbin
    A new service can be created with the service install command, with the available options shown in the following table.

    Table 4.3. service install options

    Argument or Switch Description
    /controller HOST:PORT
    The host and port of the management interface. If omitted, the default is localhost:9999.
    /host [DOMAIN_HOST]
    Indicates that domain mode is to be used, optionally specifying the name of the domain controller. If the domain controller name is omitted, the default name is master.
    /loglevel LEVEL
    The log level for the service, either: ERROR, INFO, WARN or DEBUG. If omitted, the default is INFO
    /name SERVICE_NAME
    The name of the service to be created, must not contain spaces. If omitted, the default is JBossEAP6
    /desc "DESCRIPTION"
    The description of the service. If omitted, the default is "JBoss Enterprise Application Platform 6"
    /serviceuser DOMAIN\USERNAME
    Specifies the name of the account under which the service will run. Use an account name in the format of DOMAIN\USERNAME. If omitted, the service runs as the Local System account.
    /servicepass PASSWORD
    Password for /serviceuser account.
    /jbossuser USERNAME
    Optional, the JBoss EAP 6 username to use for the shutdown command.
    /jbosspass PASSWORD
    Password for /jbossuser account, required if /jbossuser is specified.
    Below are basic examples of an install command to create a new service in either standalone or domain mode. Execute the following command, adjusting the log level for the service as required:
    • Standalone mode:
      service.bat install /loglevel INFO
    • Domain mode:
      If you are not using the default master for your JBoss EAP 6 domain controller, replace master with the correct host name or alias of the JBoss EAP 6 domain controller.
      service.bat install /host master /loglevel INFO
    A new Windows service will be created with name JBossEAP6.
  4. Verify the new service in the Services console

    Execute the following command in a terminal to open the Windows Services console:
    services.msc
    If the default service name was used, in the list of Windows services, the new service will have the display name: JBoss Enterprise Application Platform 6. From the Services console you can start and stop the service, as well change its settings on how and when it starts.
  5. Starting and stopping the JBoss EAP 6 service from a terminal

    To start the service from a terminal, use the following command, changing the service name if necessary:
    net start JBossEAP6
    To stop the service from a terminal, use the following command, changing the service name if necessary:
    net stop JBossEAP6
Result

A JBoss EAP 6 service is configured in Microsoft Windows Server.

Procedure 4.14. Uninstall the JBoss EAP 6 service from Microsoft Windows Server

  • If the service is running, first open a terminal and stop the service by executing the net stop command with the name of the service:
    net stop JBossEAP6
    In a terminal, change directories to EAP_HOME\modules\system\layers\base\native\sbin and execute the following command:
    service uninstall
Result

The JBoss EAP 6 service has been removed from Microsoft Windows Server.