Tomcat 7 Installation

Installing services

The safest way to manually install the service is to use the provided service.bat script. Administrator privileges are required to run this script. If necessary, you can use the /user switch to specify a user to use for the installation of the service.

NOTE: On Windows Vista or any other operating system with User Account Control (UAC) you must either disable UAC or right-click on cmd.exe and select "Run as administrator" in order to run this script. If UAC is enabled neither being logged on with an Administrator account, nor using the /user switch is sufficient.

Install the service named 'Tomcat7'
C:\> service.bat install

If using tomcat7.exe, you need to use the //IS// parameter.

Install the service named 'Tomcat7'
C:\> tomcat7 //IS//Tomcat7 --DisplayName="Apache Tomcat 7" \
C:\> --Install="C:\Program Files\Tomcat\bin\tomcat7.exe" --Jvm=auto \
C:\> --StartMode=jvm --StopMode=jvm \
C:\> --StartClass=org.apache.catalina.startup.Bootstrap --StartParams=start \
C:\> --StopClass=org.apache.catalina.startup.Bootstrap --StopParams=stop

Updating services

To update the service parameters, you need to use the //US// parameter.

Update the service named 'Tomcat7'
C:\> tomcat7 //US//Tomcat7 --Description="Apache Tomcat Server - http://tomcat.apache.org/ " \
C:\> --Startup=auto --Classpath=%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\bin\bootstrap.jar

Removing services

To remove the service, you need to use the //DS// parameter.
If the service is running it will be stopped and then deleted.

Remove the service named 'Tomcat7'
C:\> tomcat7 //DS//Tomcat7

Debugging services

To run the service in console mode, you need to use the //TS// parameter. The service shutdown can be initiated by pressing CTRL+C or CTRL+BREAK. If you rename the tomcat7.exe to testservice.exe then you can just execute the testservice.exe and this command mode will be executed by default.

Run the service named 'Tomcat7' in console mode
C:\> tomcat7 //TS//Tomcat7 [additional arguments]
Or simply execute:
C:\> tomcat7

参考:http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html

转载于:https://www.cnblogs.com/nevernet/archive/2011/10/09/2203649.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值