




已阅读5页,还剩2页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
将解压缩版 Tomcat 加入服务/说明:如果你已经按照第一步(即一.配置环境变量),且运行startup.bat和shutdown.bat能成功那么下面第一就不要做了,否则会出现错误1、修改bin目录中的service.bat:REM 添加下面的一行set CATALINA_HOME=%cd%如果从来没有安装过Tomcat,或者保证Services.msc启动服务管理器检查没有Apache Tomcat系统服务,到此你就可以转到第二步了。否则继续往下走/第一步一般不要了,否则可能出错!REM 按照描述修改下面的几行set SERVICE_NAME=Tomcat6REM 上面一行,Tomcat6修改成你需要的服务名,这个将是一后使用net start/stop来操作的服务名称。/注意这一步很重要,如果你的系统现在有安装tomcat6.0,那么你一定要把tomcat6改成其它名字,而且不要以tomcat6为前缀,否则会由于你系统已经存在服务tomcat6而启动失败,可以把名字改为:你的名字+Tomcat6形式set PR_DISPLAYNAME=Apache TomcatREM 上面一行,Apache Tomcat改为你需要的显示服务名,这个将显示在服务管理器中。/注意这一步也是很重要,如果你的系统现在有安装tomcat6.0,那么你一定要不Apache tomcat改成其它名字,而且不要以Apache tomcat为前缀,否则会由于你系统已经存在服务Apache tomcat而启动失败,可以把名字改为:你的名字+apache形式set PR_DESCRIPTION=Apache Tomcat Server - /tomcatREM 这一行改不改无所谓,是服务的描述,根据自己的喜好决定吧。我的tomcat6.0中bin下的service.bat(下载后没有经过其它的配置修改,保持下载时的状态)修改后如下:贴出来如下echo offrem Licensed to the Apache Software Foundation (ASF) under one or morerem contributor license agreements. See the NOTICE file distributed withrem this work for additional information regarding copyright ownership.rem The ASF licenses this file to You under the Apache License, Version 2.0rem (the License); you may not use this file except in compliance withrem the License. You may obtain a copy of the License atremrem /licenses/LICENSE-2.0remrem Unless required by applicable law or agreed to in writing, softwarerem distributed under the License is distributed on an AS IS BASIS,rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.rem See the License for the specific language governing permissions andrem limitations under the License.if %OS% = Windows_NT setlocalrem -rem NT Service Install/Uninstall scriptremrem Optionsrem install Install the service using Tomcat6 as service name.rem Service is installed using default settings.rem remove Remove the service from the System.remrem name (optional) If the second argument is present it is consideredrem to be new service name remrem $Id: service.bat 600659 2007-12-03 20:15:09Z jim $rem -rem Guess CATALINA_HOME if not definedset CURRENT_DIR=%cd%if not %CATALINA_HOME% = goto gotHomeset CATALINA_HOME=%cd%if exist %CATALINA_HOME%bintomcat6.exe goto okHomerem CD to the upper dircd .set CATALINA_HOME=%cd%:gotHomeif exist %CATALINA_HOME%bintomcat6.exe goto okHomeecho 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 programgoto endrem Make sure prerequisite environment variables are setif not %JAVA_HOME% = goto okHomeecho The JAVA_HOME environment variable is not definedecho This environment variable is needed to run this programgoto end :okHomeif not %CATALINA_BASE% = goto gotBaseset CATALINA_BASE=%CATALINA_HOME%:gotBaseset EXECUTABLE=%CATALINA_HOME%bintomcat6.exerem Set default Service nameset SERVICE_NAME=haotomcat6/原来为 set SERVICE_NAME=Tomcat6,这里hao是我的名字set PR_DISPLAYNAME=hao apache/原来为 set PR_DISPLAYNAME=Apache Tomcatif %1 = goto displayUsageif %2 = goto setServiceNameset SERVICE_NAME=%2set PR_DISPLAYNAME=Apache Tomcat %2:setServiceNameif %1 = install goto doInstallif %1 = remove goto doRemoveif %1 = uninstall goto doRemoveecho Unknown parameter %1:displayUsageecho.echo Usage: service.bat install/remove service_namegoto end:doRemoverem Remove the service%EXECUTABLE% /DS/%SERVICE_NAME%echo The service %SERVICE_NAME% has been removedgoto end:doInstallrem Install the serviceecho Installing the service %SERVICE_NAME% .echo Using CATALINA_HOME: %CATALINA_HOME%echo Using CATALINA_BASE: %CATALINA_BASE%echo Using JAVA_HOME: %JAVA_HOME%rem Use the environment variables as an examplerem Each command line option is prefixed with PR_set PR_DESCRIPTION=Apache Tomcat Server - /set PR_INSTALL=%EXECUTABLE%set PR_LOGPATH=%CATALINA_BASE%logsset PR_CLASSPATH=%CATALINA_HOME%binbootstrap.jarrem Set the server jvm from JAVA_HOMEset PR_JVM=%JAVA_HOME%jrebinserverjvm.dllif exist %PR_JVM% goto foundJvmrem Set the client jvm from JAVA_HOMEset PR_JVM=%JAVA_HOME%jrebinclientjvm.dllif exist %PR_JVM% goto foundJvmset PR_JVM=auto:foundJvmecho Using JVM: %PR_JVM%EXECUTABLE% /IS/%SERVICE_NAME% -StartClass org.apache.catalina.startup.Bootstrap -StopClass org.apache.catalina.startup.Bootstrap -StartParams start -StopParams stopif not errorlevel 1 goto installedecho Failed installing %SERVICE_NAME% servicegoto end:installedrem 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=set PR_JVM=rem Set extra parameters%EXECUTABLE% /US/%SERVICE_NAME% -JvmOptions -Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%endorsed -StartMode jvm -StopMode jvmrem More extra parametersset PR_LOGPATH=%CATALINA_BASE%logsset PR_STDOUTPUT=autoset PR_STDERROR=auto%EXECUTABLE% /US/%SERVICE_NAME% +JvmOptions -Djava.io.tmpdir=%CATALINA_BASE%temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%perties -JvmMs 128 -JvmMx 256echo The service %SERVICE_NAME% has been installed.:endcd %CURRENT_DIR%/service.bat中要修改的两处地方已经在上面要红色标出来了2、运行cmd打开控制台,进入Tomat目录/bin文件夹,输入如下命令运行。service.bat install程序提示:The service Tomcat5(或者你修改一后的SERVICE_NAME) has been installed说明服务Tomcat已经被安装成功。顺便说一下,运行service.bat remove可以移除服务。3、到这里,服务添加成功,控制台下运行services.msc,可以看到添
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 入职安全生产培训内容课件
- 重庆混凝土管理办法
- 集团相关方管理办法
- 拆迁安置补偿委托合同6篇
- 企业挂牌安全培训课件
- 纪检办案经费管理办法
- 社区私房占用管理办法
- 手术增强现实临床验证-洞察及研究
- 小学法律知识竞赛试题(附答案)
- 2025年应聘书、入职表可视为合同文件吗
- 2024-2025学年度第二学期人教版八年级数学下册暑假作业含答案(共21天)
- 院感知识:手卫生
- 希沃录制知识胶囊操作指南
- (完整)新部编人教版八年级上册历史复习提纲
- 篮球特色课程说课模板
- 代加工洗涤合同范例
- 中西医治疗心血管病
- 全国风压及雪压基本值表
- 电力系统规划教案
- 联合救治房颤患者的协议书
- 企业安全生产“百日攻坚”行动实施方案
评论
0/150
提交评论