Installing Tomcat 7 as Service on Windows Server 2008

后端 未结 9 1468
無奈伤痛
無奈伤痛 2021-02-07 05:34

I want to install my tomcat v7.0.12 as a service on my Windows 2008 Server. On the tomcat page I found this tutorial. But there isn\'t a service.bat file in my inst

9条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-07 06:15

    I have spent a couple of hours looking for the magic configuration to get Tomcat 7 running as a service on Windows Server 2008... no luck.

    I do have a solution though.

    My install of Tomcat 7 works just fine if I just jump into a console window and run...

    C:\apache-tomcat-7.0.26\bin\start.bat
    

    At this point another console window pops up and tails the logs (tail meaning show the server logs as they happen).

    SOLUTION

    Run the start.bat file as a Scheduled Task.

    1. Start Menu > Accessories > System Tools > Task Scheduler

    2. In the Actions Window: Create Basic Task...

    3. Name the task something like "Start Tomcat 7" or something that makes sense a year from now.

    4. Click Next >

    5. Trigger should be set to "When the computer starts"

    6. Click Next >

    7. Action should be set to "Start a program"

    8. Click Next >

    9. Program/script: should be set to the location of the startup.bat file.

    10. Click Next >

    11. Click Finish

    12. IF YOUR SERVER IS NOT BEING USED: Reboot your server to test this functionality

提交回复
热议问题