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 Copy linkLink copied to clipboard!
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_HOMEsystem 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>
C:\Program Files ├── jboss-eap-8.0 │ ├── bin │ └── ... └── jbcs-jsvc-<VERSION>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Install the service.
Open a terminal, and change directories to
EAP_HOME\bin.Below are examples of a basic
service.bat installcommand 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.batwithout any arguments.ImportantIf you specify the
/jbossuserand/jbosspassparameters, 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
service.bat install /loglevel INFOCopy to Clipboard Copied! Toggle word wrap Toggle overflow For a server in a managed domain:
Use the
/hostparameter 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 /hostin the management CLI.Replace
EAP_HOST_NAMEin the command below with your JBoss EAP host controller name. If you specify the`/hostparameter without providing a JBoss EAP host controller name, the name defaults tomaster.service.bat install /host EAP_HOST_NAME /loglevel INFO
service.bat install /host EAP_HOST_NAME /loglevel INFOCopy to Clipboard Copied! Toggle word wrap Toggle overflow A new Windows service will be created with name
JBossEAP8.
Verify the new
Servicein 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
net start JBossEAP8Copy to Clipboard Copied! Toggle word wrap Toggle overflow To stop the service from a terminal, use the following command, changing the service name if necessary:
net stop JBossEAP8
net stop JBossEAP8Copy to Clipboard Copied! Toggle word wrap Toggle overflow
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 Copy linkLink copied to clipboard!
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_HOMEsystem environment variable. - You have verified that the JBoss EAP server instance is not running.
Procedure
Use the
setxcommand to configure the two environment variables:-
Set the path for the
JBOSS_HOMEvariable to the JBoss EAP installation directory. -
The
jboss-cli.batscript contains the"x%NOPAUSE%" == "x" pauseline of code. This code creates a status message when you issue the pause command. To disable these messages, you must specify a value for theNOPAUSEvariable. For example, setting theNOPAUSEvariable toNOPAUSE=truedisables status messages from appearing when a script completes.
-
Set the path for the
-
Use the
setxcommand to create two system environment variables:JBOSS_HOMEandNOPAUSE.
8.3. Removing JBoss EAP service on Microsoft Windows Server Copy linkLink copied to clipboard!
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
netstop command with the name of the service:net stop JBossEAP8
net stop JBossEAP8Copy to Clipboard Copied! Toggle word wrap Toggle overflow At a command prompt, change directories to
EAP_HOME\binand execute the following command:service.bat uninstall
service.bat uninstallCopy to Clipboard Copied! Toggle word wrap Toggle overflow