9.4. Run the Application Server as a Service

Procedure 9.7. Running as a Service on Microsoft Windows Server

  1. Open a command prompt with elevated privileges.

    Navigate to C:\Windows\System32 and right-click on cmd.exe. Select Run as Administrator.
  2. Change to the JBoss Enterprise Web Platform directory where the service installation script is located.

    cd JBOSS_DIST\native\sbin
  3. Optional: Edit services.bat to pass parameters to the application server at start-up.

    Under :cmdStart, alter the following line:
    call "%SVCPATH%\run.bat" < .r.lock >> run.log 2>&1
    To run the 'default' profile binding to the 'localhost' address, change to the following: call "%SVCPATH%\run.bat" -c default -b localhost < .r.lock >> run.log 2>&1
    For a full list of parameters to run.bat see the Getting Started Guide.
  4. Run the service installation script.

    service.bat install
  5. Check that the service is installed.

    Under the Windows services list you will find this listed by the short name JBEAP5SVC and the long name JBoss EAP 5.

    Uninstalling a Service

    To uninstall the service, issue the following command from a command prompt with elevated privileges: sc delete "JBEAP5SVC".