Skip to main content

Tomcat as Window Service

This document contains steps to configure tomcat as a window service. Once tomcat configured as a window service, no need to start tomcat server by runnin start_aiv.bat file or startup.bat file. as soon as windows machine is started, tomcat server will also be started as it is configured as a window service.

Objective

objective of this document is to guide user to configure tomcat as a window service.

Reference

Kindly click on this link to get more idea about setting tomcat as service.

Set Tomcat as service

Follow below steps to set tomcat as service;

  1. Go to your directory where AIV is installed. go to tomcat folder and open bin folder. (your_directory)/AIV/tomcat/bin

  2. Search for setenv.bat and open it in text editor. check the memory size provided.

    Docusaurus Slash Introduction

  3. Search for service.bat file in this folder and open it in text editor. search for JvmMs and JvmMx in this file and set JvmMs as -Xms value you can see in setenv.bat file and set JvmMx as -Xmx value you can see in setenv.bat file. here i have to provide JvmMs=512 and JvmMx=6144

    Docusaurus Slash Introduction

  4. Save this file and close it

  5. Open command prompt and change path to bin folder.

  6. Run this command to set tomcat as service : service.bat install TomcatAIV

  • here TomcatAIV is unique service name. user can provide service name as per his convenience.

    Docusaurus Slash Introduction

  1. After executing this command, you will see message The service 'TomcatAIV' has been installed

    Docusaurus Slash Introduction

  2. To check service has been added in windows, click window key+R button to open run window and type services.msc & hit enter to open windows service.

    Docusaurus Slash Introduction

  3. You will see service name TomcatAIV in service list. that means tomcat service has been added.

  4. Right-click on this service and select properties and select startup type = Automatic and click on Apply and ok to save this changes.

    Docusaurus Slash Introduction

  5. Now, select the services, Right-click on the Apache Tomcat 9.0 TomacatAIV and start the services.

  6. Check the catelina log from (Your directory)\aiv\tomcat\logs, find catelina.log and open it.

    Docusaurus Slash Introduction

  7. If the catelina.log shows like org.apache.catalina.startup.Catalina.start Server startup in [249745] milliseconds, it means the tomcat server is started and you can use the application form the browser.

  8. open the Browser and add localhost:<port number>/aiv/ in the URL bar. For example: localhost:9091/aiv/

    Docusaurus Slash Introduction