728x90
반응형

Tomcat 8.5 기준 server.xml 을 아래와 같이 셋팅하면 톰캣하나로 여러개의

컨테이너 운영이 가능하다


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


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

  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />

  <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="CatalinaExt">

    <Connector port="8090" protocol="HTTP/1.1"

               connectionTimeout="20000"

               URIEncoding="euckr"

               redirectPort="28090" />

    <Connector port="38090" protocol="AJP/1.3" redirectPort="28090" />

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

      <Realm className="org.apache.catalina.realm.LockOutRealm">

        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"

               resourceName="UserDatabase"/>

      </Realm>

      <Host name="localhost"  appBase="/opt/ext-apache-tomcat-8.0.39/works/ext"

            unpackWARs="true" autoDeploy="true">

        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs/access/ext"

               prefix="localhost_access_log" suffix=".txt"

               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>

    </Engine>

  </Service>

  

  <Service name="CatalinaExt2">

    <Connector port="8091" protocol="HTTP/1.1"

               connectionTimeout="20000"

               URIEncoding="utf-8"

               redirectPort="28091" />

    <Connector port="38091" protocol="AJP/1.3" redirectPort="28091" />

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

      <Realm className="org.apache.catalina.realm.LockOutRealm">

        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"

               resourceName="UserDatabase"/>

      </Realm>

      <Host name="localhost"  appBase="/opt/ext-apache-tomcat-8.0.39/works/ext2"

            unpackWARs="true" autoDeploy="true">

        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs/access/ext2"

               prefix="localhost_access_log" suffix=".txt"

               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>

    </Engine>

  </Service>

</Server>

728x90
반응형
블로그 이미지

nineDeveloper

안녕하세요 현직 개발자 입니다 ~ 빠르게 변화하는 세상에 뒤쳐지지 않도록 우리모두 열심히 공부합시다 ~! 개발공부는 넘나 재미있는 것~!

,