美文网首页
tomcat发布war

tomcat发布war

作者: 毛仑上保罗先生 | 来源:发表于2018-12-28 17:36 被阅读0次

    1,将xxx.war包拷贝到tomcat的webapps文件夹(我的war名称为 unnamed.war)
    2,配置conf中的server.xml

     <Host name="localhost"  appBase="webapps"
                unpackWARs="true" autoDeploy="true">
            <!-- SingleSignOn valve, share authentication between web applications
                 Documentation at: /docs/config/valve.html -->
            <!--
            <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
            -->
    
            <!-- Access log processes all example.
                 Documentation at: /docs/config/valve.html
                 Note: The pattern used is equivalent to using pattern="common" -->
            <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
                   prefix="localhost_access_log" suffix=".txt"
                   pattern="%h %l %u %t &quot;%r&quot; %s %b" />
            <!--新加-->
            <Context path="/unnamed" docBase="unnamed" reloadable="true"/>
          </Host>
    

    path: 路径
    docBase: war包的路径, 可以直接指定E:/x/xx

    默认情况下tomcat的port为8080


    image.png

    运行bin中的startup.bat或者startup.sh
    然后访问http://localhost:8080/unnamed/

    image.png

    相关文章

      网友评论

          本文标题:tomcat发布war

          本文链接:https://www.haomeiwen.com/subject/zcselqtx.html