Chapter 8. Running and removing JBoss EAP as a service on Microsoft Windows Server
8.1. Running 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
- You have installed JBoss EAP.
- You have administrator privileges on the server.
-
You have set the
JAVA_HOME
system environment variable.
Procedure
Install the JBoss Core Services Jsvc Package.
If not already configured, download and extract the JBoss Core Services Jsvc package.
- Open a browser and log in to the Red Hat Customer Portal JBoss Software Downloads page.
- Select Apache Jsvc in the Product drop-down menu.
- Select the latest version from the Version drop-down menu.
- Find Red Hat JBoss Core Services Apache Jsvc in the list, ensuring that you select the correct platform and architecture for your system, and click the Download link.
- 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 level as your JBoss EAP installation directory. For example:C:\Program Files ├── jboss-eap-8.0 │ ├── bin │ └── ... └── jbcs-jsvc-<VERSION>
Install the service.
Open a terminal, and change directories to
EAP_HOME\bin
.Below are examples of a basic
service.bat install
command to create a new service for either a standalone server, or a server in a managed domain. For a list of all possible options, runservice.bat
without any arguments.ImportantIf 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 (;
).
Adjust the log level for the service as required:
For a standalone server:
service.bat install /loglevel INFO
For a server in a managed domain:
Use the
/host
parameter to specify the name of the JBoss EAP host controller that is managed by the service. To list valid values for the name by executingls /host
in the management CLI.Replace
EAP_HOST_NAME
in the command below with your JBoss EAP host controller name. If you specify the`/host
parameter without providing a JBoss EAP host controller name, the name defaults tomaster
.service.bat install /host EAP_HOST_NAME /loglevel INFO
A new Windows service will be created with name
JBossEAP8
.
Verify the new
Service
in the Services console.Open the Windows Services console (
services.msc
) and verify that the service was created.If the default service name was used, in the list of Windows services the new service will have the display name:
JBossEAP8
. From the Services console you can start and stop the service, as well change its settings of how and when it starts.
Starting and stopping the JBoss EAP Service from a Terminal.
To start the service from a terminal, use the following command, changing the service name if necessary:
net start JBossEAP8
To stop the service from a terminal, use the following command, changing the service name if necessary:
net stop JBossEAP8
Additional resources
- To learn more about how to set environment variables on a Microsoft Windows Server, refer to the Microsoft Windows documentation.
8.2. 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.
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
- You have installed JBoss EAP.
- You have administrator privileges on the server.
-
You have set the
JAVA_HOME
system environment variable. - You have verified that the JBoss EAP server instance is not running.
Procedure
Use the
setx
command to configure the two environment variables:-
Set the path for the
JBOSS_HOME
variable to the JBoss EAP installation directory. -
The
jboss-cli.bat
script contains the"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 theNOPAUSE
variable. For example, setting theNOPAUSE
variable toNOPAUSE=true
disables status messages from appearing when a script completes.
-
Set the path for the
-
Use the
setx
command to create two system environment variables:JBOSS_HOME
andNOPAUSE
.
8.3. Removing JBoss EAP service on Microsoft Windows Server
You can remove an instance of JBoss EAP and any services associated with it. Thereafter, you can install JBoss EAP by using a suitable installation method.
Prerequisites
- You have JBoss EAP installed.
Procedure
When 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 JBossEAP8
At a command prompt, change directories to
EAP_HOME\bin
and execute the following command:service.bat uninstall