Configure tomcat as a system service under windows

  1. Modify startup.bat

    Add the following before the first line:

    SET
    JAVA_HOME=D:\ProgramFiles\tool\Java\jdk6

    SET
    CATALINA_HOME=D:\ProgramFiles\Tomcat6

    JAVA_HOME is the content configured in the environment variable. CATALINA_HOME is the directory of Tomcat

  2. Modify shutdown.bat

    Add the following before the first line:

    SET JAVA_HOME=D:\ProgramFiles\tool\Java\jdk6

    SET
    CATALINA_HOME=D:\ProgramFiles\Tomcat6

  3. Modify service.bat

    Add before the first line:

    set
    CATALINA_HOME=D:\ProgramFiles\Tocmat6

    set
    SERVICE_NAME=Tomcat6

    set
    PR_DISPLAYNAME=Apache Tomcat

    Needless to say, the first line is the name of the service, which is used to control the service (start/stop) on the command line.

    The third line is the display name of the service, which is the name displayed in the service manager.

  4. Add service

    In the DOS interface, enter the bin directory of the Tomcat decompression directory and enter the command: service remove
    tomcat6

    service.bat install

    If the installation is successful, it will prompt: The service'Tomcat6 (or your modified SERVICE_NAME)' has
    been installed

  5. At this point, configuring Tomcat as a system service is complete!

Guess you like

Origin blog.csdn.net/cainiaochen3/article/details/81537679
Recommended