国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > Tomcat > 正文

手工把tomcat5安裝成windows服務

2024-09-06 19:01:08
字體:
來源:轉載
供稿:網友

由于習慣直接解壓縮,然后拷貝整個tomcat到服務器上,因此需要手工把tomcat安裝成windows服務;

利用以下腳本即可實現:
rem
rem nt service install/uninstall script
rem
rem options
rem install install the service using tomcat5 as service name.
rem service is installed using default settings.
rem remove – remove the service from the system.
rem
rem name (optional) if the second argument is present it is considered
rem to be new service name
rem
rem $id: service.bat,v 1.5 2004/04/08 16:49:37 mturk exp $
rem - — — — — — — — — — — — — — — — — — — — — — — — — — –
rem guess catalina_home if not defined
set current_dir=%cd%
if not "%catalina_home%" == "" goto gothome
set catalina_home=%cd%
if exist "%catalina_home%/bin/tomcat5.exe" goto okhome
rem cd to the upper dir
cd ..
set catalina_home=%cd%
:gothome
if exist "%catalina_home%/bin/tomcat5.exe" goto okhome
echo the tomcat.exe was not found…
echo the catalina_home environment variable is not defined correctly.
echo this environment variable is needed to run this program
goto end
:okhome
if not "%catalina_base%" == "" goto gotbase
set catalina_base=%catalina_home%
:gotbase

set executable=%catalina_home%/bin/tomcat5.exe

rem set default service name
set service_name=tomcat5

if "%1" == "" goto displayusage
if "%2" == "" goto setservicename
set service_name=%2
:setservicename
if %1 == install goto doinstall
if %1 == remove goto doremove
echo unknown parameter "%1"
:displayusage
echo
echo usage: service.bat install/remove [service_name]
goto end

:doremove
rem remove the service
"%executable%" //ds//%service_name%
echo the service '%service_name%' has been removed
goto end

:doinstall
rem install the service
rem use the environment variables as an exaple
rem each command line option is prefixed with pr_

set pr_displayname=apache tomcat
set pr_description=apache tomcat server – http://jakarta.apache.org/tomcat
set pr_install=%executable%
set pr_logpath=%catalina_home%/logs
set pr_classpath=%catalina_home%/bin/bootstrap.jar
"%executable%" //is//%service_name% --jvm %java_home%/jre/bin/server/jvm.dll --startclass org.apache.catalina.startup.bootstrap --stopclass org.apache.catalina.startup.bootstrap --startparams start --stopparams stop --stopmode jvm --startmode jvm
rem clear the environment variables. they are not needed any more.
set pr_displayname=
set pr_description=
set pr_install=
set pr_logpath=
set pr_classpath=
rem more extra parameters
set pr_stdoutput=%catalina_home%/logs/stdout.log
set pr_stderror=%catalina_home%/logs/stderr.log
"%executable%" //us//%service_name% --jvmoptions "-djava.io.tmpdir=%catalina_base%/;-dcatalina.home=%catalina_base%/;-djava.endorsed.dirs=%catalina_base%/common/endorsed/;"
echo the service '%service_name%' has been installed

:end
cd %current_dir%

在5.0.*測試通過

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 馆陶县| 德惠市| 仙游县| 嵩明县| 巩义市| 武宣县| 武平县| 扶绥县| 苏尼特左旗| 兴隆县| 龙游县| 洛阳市| 获嘉县| 宜阳县| 南宫市| 高要市| 株洲市| 遵义市| 琼结县| 雷州市| 法库县| 邯郸市| 绩溪县| 张家口市| 阿克苏市| 根河市| 远安县| 吴江市| 武功县| 宿松县| 渑池县| 秭归县| 三亚市| 水城县| 广丰县| 安化县| 米易县| 邯郸县| 尉犁县| 仁化县| 云霄县|