Apache tomcat启动

时间:2012-12-12 09:02:20

标签: tomcat batch-file

我正在尝试启动tomcat服务器throug命令提示符,但未设置其显示CATALINE_HOME变量。我通过转到控制面板来设置变量,然后也会出现相同的错误。

如果我直接转到starttup.bat文件并尝试运行它,它就会闪烁然后继续运行。所以我尝试在最后添加暂停命令然后当我运行时我得到

using CATALINA _BASE :"C:\apache-tomcat-7.0.26"
using CATALINA _HOME:"C:\apache-tomcat-7.0.26"
using CATALINA _TMPDIR :"C:\apache-tomcat-7.0.26\temp"
using JRE_HOME :"C:\programfiles\java\jre"
using CLASSPATH :"C:\apache-tomcat-7.0.26\bin\bootstrap.jar;"C:\apache-tomcat-7.0.26\bin\tomcat-juli.jar

这是最近的目录内容。

    ... 17 more
Dec 12, 2012 3:59:17 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Dec 12, 2012 3:59:17 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 445 ms
Dec 12, 2012 3:59:17 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Dec 12, 2012 3:59:17 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
Dec 12, 2012 3:59:17 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.26\webapps\docs
Dec 12, 2012 3:59:17 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.26\webapps\examples
Dec 12, 2012 3:59:17 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.26\webapps\host-manager
Dec 12, 2012 3:59:17 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.26\webapps\manager
Dec 12, 2012 3:59:17 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.26\webapps\ROOT
Dec 12, 2012 3:59:17 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Dec 12, 2012 3:59:17 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 468 ms
Dec 12, 2012 4:01:06 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Dec 12, 2012 4:01:06 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Dec 12, 2012 4:01:06 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Dec 12, 2012 4:01:06 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Dec 12, 2012 4:01:06 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Dec 12, 2012 4:01:06 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Dec 12, 2012 4:01:06 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]

3 个答案:

答案 0 :(得分:0)

这可能是因为该过程已在后台运行。如有必要,请致电shutdown.bat停止。

否则您应该能够在http://localhost:8080/html/manager访问该经理。 在此之前,您可能需要先配置用户/密码,然后重新启动tomcat。

请参阅tomcat documentation了解详情。

答案 1 :(得分:0)

您必须先定义两个变量

  1. JAVA_HOME
  2. CATALINA_HOME
  3. 以下是您可以使用的bat文件 这里%TOMCAT_LOC% =您的tomcat路径(请不要包含bin)

    echo Stopping Tomcat App Server
    cd /D %TOMCAT_LOC%
    set JAVA_HOME=C:\Program Files\jdk echo java Path
    set CATALINA_HOME=%TOMCAT_LOC%
    call %TOMCAT_LOC%\bin\shutdown.bat
    echo Stopped Tomcat 
    

答案 2 :(得分:0)

您可以移动到包含批处理文件(tomcat / bin)的路径,然后运行批处理文件

C:\ Users> cd C:\ apache-tomcat-6.0.35 \ bin

C:\ Apache的Tomcat的6.0.35 \ BIN>的startup.bat