zoukankan      html  css  js  c++  java
  • Tomcat一对多遇到得问题

    tomcat得server.xml文件,配置如下,注意端口号问题:

    <?xml version='1.0' encoding='utf-8'?>

    <Server port="8005" shutdown="SHUTDOWN">

    <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
    <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
    <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />


    <GlobalNamingResources>

    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved"
    factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
    pathname="conf/tomcat-users.xml" />
    </GlobalNamingResources>

    <Service name="Catalina">

    <Connector port="8888" protocol="HTTP/1.1"
    connectionTimeout="20000"
    redirectPort="8443" />

    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

    <Engine name="Catalina" defaultHost="localhost">

    <Realm className="org.apache.catalina.realm.LockOutRealm">
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
    resourceName="UserDatabase"/>
    </Realm>

    <Host name="localhost" appBase="webapps"
    unpackWARs="true" autoDeploy="true">
    <Context path="" docBase="F:/tax/apache-tomcat-8.0.11/webapps/tax"> </Context>

    <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" />

    </Host>
    </Engine>
    </Service>

    <Service name="Catalina1">

    <Connector port="9090" protocol="HTTP/1.1"
    connectionTimeout="20000"
    redirectPort="8543" />

    <Connector port="8059" protocol="AJP/1.3" redirectPort="8543" />

    <Engine name="Catalina1" defaultHost="localhost">

    <Realm className="org.apache.catalina.realm.LockOutRealm">
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
    resourceName="UserDatabase"/>
    </Realm>

    <Host name="localhost" appBase="webapps1"
    unpackWARs="true" autoDeploy="true">
    <Context path="" docBase="F:/tax/apache-tomcat-8.0.11/webapps1/item"> </Context>

    <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" />

    </Host>
    </Engine>
    </Service>

    </Server>

    一个tomcat,二个项目,二个端口。

    将二个项目分别放在不同得webapps中,还有server.xml得配置别配错了哟

  • 相关阅读:
    java_windows下修改eclipse的默认编码
    54. Spiral Matrix (Graph)
    74. Search a 2D Matrix (Graph; Divide-and-Conquer)
    48. Rotate Image (Array)
    119. Pascal's Triangle II (Graph; WFS)
    118. Pascal's Triangle (Array)
    127. Word Ladder (Tree, Queue; WFS)
    117. Populating Next Right Pointers in Each Node II (Tree; WFS)
    116. Populating Next Right Pointers in Each Node (Tree; WFS)
    107. Binary Tree Level Order Traversal II(Tree, WFS)
  • 原文地址:https://www.cnblogs.com/zz-skill/p/10895344.html
Copyright © 2011-2022 走看看