Configuring the service

In the service.bat file, you need to configure the service name, description, and memory allocation. The Tomcat monitor file name also must be updated to reflect the change to the service name.

After you copy the Tomcat service installation files, before you can start the service, you need to update service.bat to:

If you change the service name, then you also must change the name of the Tomcat monitor executable.

To update the configuration:

  1. Open the file service.bat.
  2. In the file, find the following lines:
    set SERVICE_NAME=Tomcat6
    set PR_DISPLAYNAME=Apache Tomcat 6
  3. Change the name and display name to reflect your Studio installation. For example:
    set SERVICE_NAME=Studio24
    set PR_DISPLAYNAME=Studio 2.4
  4. Next, find the following line:
    set PR_DESCRIPTION=Apache Tomcat 6.0.35 Server - 
    http://tomcat.apache.org/
  5. Change the service description to reflect your Studio installation. For example:
    set PR_DESCRIPTION=Studio server, version 2.4
  6. Next, find the following line:
    "%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties" --JvmMs 128 --JvmMx 256
  7. Replace the last part of the line:
    -Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties" --JvmMs 128 --JvmMx 256

    with:

    -Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties;-XX:MaxPermSize=256m" --JvmMs 256 --JvmMx 1024

    Make sure that there are no manual line breaks or extra spaces.

  8. Immediately below that line, add the following line:
    "%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Dfile.encoding=UTF8;-Djava.net.preferIPv4Stack=true;-Duser.timezone=GMT;-Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl;-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl;-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"

    Make sure there are no manual line breaks or extra spaces.

  9. Save and close the file.
  10. Create a copy of the Tomcat monitor file (tomcat6w.exe). Rename the copy to be <value of SERVICE_NAME>w.exe.

    For example, if you set SERVICE_NAME=Studio24 in service.bat, then you must rename the copy of the tomcat6w.exe to Studio24w.exe.