Run XP as a Windows service
Step by step guide for installing Enonic XP as Windows service
Start by download windows service wrapper binary this popular from Github repo. Rename the downloaded file to desired service name, i.e
Create new xml file named
xp-service.xml in the same location as
|xml file must be named exactly the same as exe in order for the service to discover it|
Refer to the config description to see all available options.
%BASE% variable always points to the config file location:
<service> <id>xp-service</id> <name>Enonic XP Service</name> <description>Enonic XP distribution run as a MS Windows service.</description> <env name="XP_INSTALL" value="%BASE%/enonic-xp-windows-sdk-7.0.0"/> (1) <env name="JAVA_HOME" value="%XP_INSTALL%/jdk"/> (2) <env name="XP_HOME" value="%BASE%/xp-service-home"/> (3) <executable>%XP_INSTALL%/bin/server.bat</executable> <log mode="roll-by-size-time"> (4) <sizeThreshold>10240</sizeThreshold> <pattern>dd-MM-yyyy</pattern> <autoRollAtTime>00:00:00</autoRollAtTime> <keepFiles>7</keepFiles> </log> <serviceaccount> (5) <domain>***user domain***</domain> <user>***user name***</user> <password>***user password***</password> <allowservicelogon>true</allowservicelogon> </serviceaccount> </service>
|1||XP_INSTALL sets the location of your unzipped enonic XP distribution|
|2||JAVA_HOME specifies location of Java within the XP distro (system-wide
|3||XP_HOME defines the location of Enonic XP home folder (defaults to %XP_INSTALL%/home)|
|4||log rotates log using <pattern> provided by both date and file size|
|5||serviceaccount specifies user account (and password) that the service will run as (
| To know your user name and domain type
|You need to start cmd.exe with administrator permissions to run service commands|
First, we need to install our new service. Run the following command:
Verify that the service was installed by looking at the output:
2019-06-20 18:09:38,107 INFO - Installing the service with id 'xp-service'
xp-service.exe is the name of the service wrapper you downloaded earlier.
You can check its status now by running following command:
If you have not already started the service, you should see the following:
Service is stopped by default and we need to start it with the following command:
You should see something like this in the output:
2019-06-20 18:12:44,698 INFO - Starting the service with id 'xp-service'
To stop the service type:
You should now see something like this:
2019-06-20 18:17:14,588 INFO - Stopping the service with id 'xp-service'
To uninstall the service type:
Should produce output as follows:
2019-06-20 18:18:02,356 INFO - Uninstalling the service with id 'xp-service'