Jahia 7.x as a Windows service

  Written by The Jahia Team
 
Sysadmins
   Estimated reading time:
7.11
How to install Jahia 7.x as a Windows service?

Answer

Start by downloading the proper binary distribution of Tomcat 8 for your Windows platform (https://tomcat.apache.org/download-80.cgi )

  • Windows 32bit: 32-bit Windows zip (pgp, md5, sha1)
  • Windows 64bit: 64-bit Windows zip (pgp, md5, sha1)

Then install and configure it as a Windows service as described in https://tomcat.apache.org/tomcat-8.0-doc/windows-service-howto.html

  • In the paragraph "Installing services", you can run the script service.bat
  • In the Apache Tomcat distribution :
    cd [Your Apache Tomcat Distribution]/bin
    service.bat install

     

  • The following service is installed: Apache Tomcat8.0 Tomcat8


Finally install DXM into an existing Tomcat installation, following the steps of https://academy.jahia.com/documentation/digital-experience-manager/7.1/technical/configuration-and-fine-tuning/installation#Application_server_specific_installations

When running the Tomcat as Windows service, the JVM options from tomcat/bin/setenv.bat, are not taken into consideration and have to be added into "++JvmOptions" service parameter.

You can also use the tomcat8w, the GUI application to set these JVM options.
If so, you have to set Initial memory pool to 2048m and Maximum Memory pool to 4096m, otherwise, the DXM service will not start.

In case you are facing this error: org.jahia.services.templates.ModuleBuildHelper: Cannot set maven executable to mvn, please check your configuration

  1. Open the jahia.properties file under DigitalExperienceManager-EnterpriseDistribution-7.1.2.0/D/digital-factory-config/jahia
  2. Search the string: mvnPath
  3. You should find this setting: 
    #mvnPath = mvn
  4. Change the setting to: 
    mvnPath = mvn.cmd
  5. Save the change
  6. Double-check that the mvn.cmd script exists under your Apache Maven installation: C:\Program Files\apache-maven-3.3.9\bin (for instance). Otherwise, you have to create it by duplication the mvn.bat
    and to rename the duplication to mvn.cmd
  7. Stop and restart the service

If the issue persists, this is likely possible that the Tomcat 8 service was started with the System account.
To change to the user account:

  1. Access to the Windows service panel.
  2. Right-click on your tomcat 8 service.
  3. Select "Properties".
  4. Select "Connection" tab.
  5. Select the user account and enter your Windows username and password.
  6. Stop and restart the service.