Skip to main content
07 Aug 2012

Steps to Configure Alfresco FSR as Windows Service using Java Service Wrapper

  1. Download Java Service Wrapper (http://wrapper.tanukisoftware.org/doc/english/introduction.html) from following URL.
    http://wrapper.tanukisoftware.org/doc/english/download.jsp We downloaded Community Version for 32 bit windows. Java Service Wrapper features include Run a Java application as a Windows Service or Unix Daemon, Java Application Reliability, Standard, Out of the Box Scripting, On Demand Restarts, Flexible Configuration, Ease Application Installations, Logging etc.

  2. Java Service Wrapper download comes as ZIP archive. Unzip the downloaded ZIP archive to particular folder. i.e. C:\wrapper

  3. Download and Configure Alfresco FSR Deployer. Please configure “FSR_HOME” as Environment Variable to point “Alfresco FSR Deployer” folder.

  4. Create a jar file “deployment-config.jar “ and add a " deployment.properties" & “log4j.properties“ from FSR Deployer 3.1. This jar file will be added to wrapper's classpath later.
    (command to create jar file:
    jar -cvf deployment-config.jar deployment.properties log4j.properties)

  5. Copy following files from "C:\wrapper\src\bin" to "wrapper\bin" directory and remove ".in" from file name to convert it to batch file.

  • InstallApp-NT.bat.in (after rename it should be " InstallApp-NT.bat" ) - This file is responsible for installing FSR as windows service.

  • UninstallApp-NT.bat.in (after rename it should be " UninstallApp-NT.bat" )- This file is responsible for uninstalling FSR as windows service

  1. Perform following changes to "wrapper/conf/wrapper.conf" file.

  • change " wrapper.java.command" to "%JAVA_HOME%/bin/java"

  • change " wrapper.java.mainclass" to "org.tanukisoftware.wrapper.WrapperStartStopApp"

  • Add following classpath entries. Remove default entries for classpath

    • wrapper.java.classpath.1=../lib/wrapper.jar

    • wrapper.java.classpath.2=%JAVA_HOME%/lib/tools.jar

    • wrapper.java.classpath.3=%FSR_HOME%/alfresco-deployment.jar

    • wrapper.java.classpath.4=%FSR_HOME%/alfresco-core.jar

    • wrapper.java.classpath.5=%FSR_HOME%/commons-logging-1.1.jar

    • wrapper.java.classpath.6=%FSR_HOME%/jug-lgpl-2.0.0.jar

    • wrapper.java.classpath.7=%FSR_HOME%/log4j-1.2.15.jar

    • wrapper.java.classpath.8=%FSR_HOME%/spring-2.0.8.jar

    • wrapper.java.classpath.9=%FSR_HOME%/deployment-config.jar

  • Add following additions parameters.

    • wrapper.java.additional.1=-Dcatalina.base=..

    • wrapper.java.additional.2=-Dcatalina.home=..

    • wrapper.java.additional.3=-Djava.io.tmpdir=../temp

  • Add following Application Parameters

    • wrapper.app.parameter.1=org.alfresco.deployment.Main

    • wrapper.app.parameter.2=1

    • wrapper.app.parameter.3=%FSR_HOME%/application-context.xml

    • wrapper.app.parameter.4=org.alfresco.deployment.Main

    • wrapper.app.parameter.5=TRUE

    • wrapper.app.parameter.6=1

    • wrapper.app.parameter.7=%FSR_HOME%/shutdown-context.xml

  • Change service naming related parameters as below.

    • wrapper.name=Alfresco FSR

    • wrapper.displayname=Alfresco FSR

    • wrapper.description=Alfresco FSR

  1. After performing above settings, run “c:\wrapper\bin\InstallApp-NT.bat “ file. You should be able to see “Alfresco FSR” service in list of windows services. To uninstall the same, use “c:\wrapper\bin\UninstallApp-NT.bat “ file.
    (To View list of services, go to Run → “services.msc” or Go to Control Panel → Administrative Tools → Services)

    After installation, for the first time you will be required to start the Service manually. Service is installed as start-up type Automatic. So service will be started automatically over server restarts.

  1. All alfresco FSR related logs will be generated under, “C:\wrapper\bin” folder. All wrapper related logs will be generated under “C:\wrapper\logs\wrapper.log”. So to troubleshoot, follow logs under wrapper.log file. This configuration can be change using “conf/wrapper.conf” file.

    Configuration Settings Used

    OS

    Windows XP (32-bit)

    CPU

    x86

    Alfresco

    3.1

    Java

    JDK 1.6

    Note: Make sure environment variable “JAVA_HOME” is configured to point Java 6.

     

    To use it for Windows 64 bit, you need to purchase a license and different version of wrapper binary. (http://wrapper.tanukisoftware.org/doc/english/download.jsp) Put the generated license under “conf” directory of your wrapper directory. No other changes required in above configuration.

By
Snehal Shah, Ghanshyam Rathod & Varun Shah
CIGNEX, India Office