  Tomcat On Linux

  ȿnogadax@kldp.org
  2  : 2000,10,10 / 3  : 2000,11,11 / 4  :
  2001,01/11

  Tomcat The Jakarta Project 깰̸ Ȩ
  http://jakarta.apache.org <http://jakarta.apache.org> ̴.  Jakarta
  Project  ǥ ¼ҽȭǾ ߵ Java ÷  Ͽ
   ǰ  ַ(Server Solution)  ϱ ̴.  Tomcat
   Java Servlet 2.2  JavaServer Page 1.1    ̸
  ̸ "Servlet Container"  Ѵ. Tomcat Ÿ Web Server  
      Ӹƴ϶ Apache  Plug-In ·  
  ִ.  Ÿ Tomcat   ü Web Server ó    
       Web Server  ϱ
  Ѵ.  Tomcat  SUN,IBM  Italio  Ż ȸ 
  ڵ̸ ߿ ִ      ִ
  е Jakarata Ȩ ãٶ.  Ÿ XML  Ű cocoon 
  Ȩ  http://xml.apache.org <http://xml.apache.org> ̴. cocoon
   XML   óϿ ̸  ִ Ű
  ġ ϹǷ Tomcat ġÿ ߰ ġϸ ϴ.  This
  document can be freely translated and distributed. It,s released under
  the LDP License.
  ______________________________________________________________________

  

  1. Tomcat Overview
     1.1 Release Notes For Tomcat
     1.2 Ĺ  
     1.3 Web Server Plugin

  2. Tomcat 3.1 Getting Started
  3. Tomcat 3.1 ġ
     3.1 Tomcat 3.1 ġ
     3.2 ϱ
     3.3 Tomcat 3.1 ϱ
     3.4 ϱ
     3.5 Tomcat 3.1 ׽Ʈϱ
     3.6 Servlet 

  4. Jakarta-tomcat/conf 丮 server.xml 
  5. server.dtd 
  6. server.xml  tomcat.conf  
     6.1  1
     6.2  2
     6.3  3

  7. Web Application,war,web.xml
  8. PostgreSQL  JDBC    ѱó
     8.1 PostgreSQL  JDBC 
     8.2 Tomcat  ѱ ó
     8.3 PostgreSQL 7.0.2's JDBC  ѱó

  9. cocoon 1.8
     9.1 cocoon ġ
     9.2 cocoon ׽Ʈ

  10. Cocoon 1.8 Ÿ
     10.1 Cocoon 1.8  euc-kr Encoding
     10.2  xml 

  11. Tomcat 3.2.1 ġ
     11.1 Tomcat 3.2.1(mod_jserv,Ajpv12)
     11.2 tomcat.conf  (Tomcat 3.2.1)
     11.3 Tomcat 3.2.1 (mod_jk.so, Ajp13)
     11.4 stand-alone 

  12. Thread Pool  (Tomcat3.2.1)
     12.1 Thread   
     12.2   ذå
     12.3 Thread Pool  

  13. Tomcat Workers
     13.1 Ŀ ϱ
     13.2 Ŀ Ÿ
     13.3 Ÿ

  14. Ÿ 

  ______________________________________________________________________

  1.  Tomcat Overview

  Tomcat 3.1  ޸, Ĺ 3.2   ȭ ̷  ϴ.
  Ĺ 3.1 servlet  JSP spec     ̶ 3.2
  ʹ ս Ʃ ,Ȱ (SSL..), Ĺ ü
   Ǯ   mod_jserv  web-server-plugin ۼ(mod_jk)
    ø̼    .   4.0
  ʹ  븦 ɾ  ϴ.  ڼ  Tomcat
    ϱ ٶ.

  1.1.  Release Notes For Tomcat

  Tomcat 3.1

  o  Servlet  JSP spec ⺻ 

  o  SSL  ȵ

  o  Automatic servlet reloading 

  o  WAR  

  o  Netscape  IIS 

  o  Ÿ..

  Tomcat 3.2

  o  Apache 1.3   

  o  MS IIS 4.0   

  o  MS Personal Web Server 4.0  

  o  Netscape Enterprise server 3.0  

  o  Tomcat 3.1    

  o  Tomcat 3.1  ó ս Ʃ

  o  Ĺ ü Threaded Pooling 

  o  mod_jserv ۼ mod_jk 

  o  mod_jserv  mod_jk  

  o  mod_jk  Ajpv13 

  o  Ÿ..

  Tomcat 3.2.1

  o  Ĺ 3.2    

  o  Ĺ 3.2   (security)  Ʈ

  o  SSL 

  o  WEB-INF 丮 JSP û  ȵ( : /WEB-INF/dummy.jsp)

  o  JDBC  ó   ϱ JDBC ܿ  
     ó(JDBCRealm)

  o  Ÿ..

  Tomcat 4.0

  o  2001 1  

  o  Ĺ 3.x  ſ ٸ  (īŻ Ű)

  o  Servlet 2.3  JSP 1.2 

  o  Ÿ..

  1.2.  Ĺ  

  A. Stand_alone

        a. Ĺ ȥڼ    Servlet ̳   ó
           ,   ø̼ ̴.
        b. Ĺ Stand-alone   Static File  ó CPU .
           static file  : HTML, Image files
        c. Apache ó Ȯ强(perl,php)  ȭϵ ó ߰ .
        d. ׷Ƿ Apache   Ͽ óϴ  ȿ.

  B. In-Process

        a. Apache2.0   Multi-Threaded-Server  ʿ.
        b. out-process     .
        c. apache  μ JVM  .
           ̴ web-server-plugin  .
        d. JNI 

  C. Out-Process

        a. TCP/IP ϴ IPC 
        b.  μۿ JVM 
        c. ݷδ Ajpv12  Ajpv13  

  1.3.  Web Server Plugin

  * Web-Server-Plugin Ĺ  Ͽ   ֵ
   

  * Ŭ̾Ʈ Servlet Ȥ JSP û  Web-Server-
  plugin  

  * , Web-Server-Plugin  ޹ ޽ Ĺ .

  * , Web-Server-Plugin (Apache) Ĺ ǻ
  .

  * Ĺ3.1  web-server-plugin mod_jserv.so  Ѵ.

  * Ĺ3.2  Web-Server-Plugin mod_jserv.so  mod_jk.so 
  ΰ Ѵ.

  *    web-server-plugin ʿ  Ʈ
  (Ajp..).

  * ġ  Ĺ̿  Ʈ ݷ   ϸ
  Ÿ ȣƮ  ʿ.

  *  mod_jserv.so  mod_jk.so  ̴.

  a. mod_jserv.so

        - ϴ.
        -SSL ϴ HTTPS  ȵ
        -Ajpv12  
        -    ..
        -Tomcat 3.1, 3.2  
        -Ÿ..

  b. mod_jk.so

        -  ʴ.
        -mod_jserv.so  ణ   ƴϴ.
        -mod_jserv   ۼ ̴.
        -ġ, ݽ 
        -ġ 1.3.x  ġ 2.x.x 
        -Tomcat 3.2 
        -SSL 
        -Ajpv 12  Ajpv13  
        -Ÿ

  2.  Tomcat 3.1 Getting Started

  ڹ  tomcat  ġ   ٸ 깰̴.  JSDK(servlet)
  ġ  tomcat ġ servlet jsp ٷ    ִ.

  Tomcat JSP ȯ ϴ Servlet Container ̴.  Servlet
  Container ڸ Ͽ Servlet  ϰ Invoke ϴ ǽð
  (Runtime Shell)̴.

  ̴  Servlet  ϴ Jserv ʹ ٸ Tomcat  ǥ
  ̴ JSDK  ʿٴ ̸ Jserv Servlet 2.0  ϳ
  Tomcat Servlet 2.2 JSP 1.1 Ѵٴ ̴.

  Servlet Container ũ  зǸ  .

  1.Stand-alone Servlet Container : Tomcat ü ڹ  Web
  Server ȴ.  ̴ Tomcat  Default mode ̴.

  2.In-process Servlet Container : Web Server Plugin Java Container
     ̸ Apache  Web Server  ߰Ͽ ϴ
  ̴. ϳ μ Ƽ 带  ̸ ̴ 
  ս(performance)  ϳ μ   Ƽ
  ȭǾ ǹǷ     ѵȴ( limited
  Scalability).  ´ Web Server Plugin  JVM Web Server
  ּ(Address)  open    ּ  JVM   
  ֵ ϰ Ѵ.  Ϸ  û  Plugin
   ޾ Java Container ǳش.

  3.Out-of-process Servlet Container : In-process Servlet Container 
  ϳ JVM  Web Server ּҿ ܺο ȴ. Web Server
  Plugin  Java Container(JVM)  IPC Ŀ(밳 TCP/IP )
  Ͽ Ѵ.   Ϸ  û   plugin
    ޾ IPC ī Ͽ Java Container(JVM) 
  ǳش.  Out-of-process  û  ð(response time)
   In-processٴ   scalability  stability  .

  Ÿ servlet   Ź Ҷ ġ ⵿ ٷ 
     ־ ڿԴ  ̴. ( ü
  ϵ   ٷ ε ȵǰ  ׿ٰ ٽ
  ϸ Ǵµ ̰ ̷ ƽô  ̳  Ȩ 
  ּ)

  Ÿ   Tomcat  ּ ̹Ƿ Tomcat   ٸ
  鵵 ϱ ٶ.     ƮJakarta 
  Ȩ <http://jakarta.apache.org≯ Ÿ http://kldp.org
  <http://kldp.org>  "Tomcat"  ˻ Ͽ  Tip
  ãų http://webdox.co.kr <http://webdox.co.kr>  νĴ԰
  輼 Բ   ã ϱ ٶ.

  ( Ȩ http://user.chollian.net/~nogadax
  <http://user.chollian.net/~nogadax> ̰    ɼ
   ﰡּ.  Ȩ  Խ ֽ̿ñ ٶϴ.)

  3.  Tomcat 3.1 ġ

   ׽Ʈȯ  

  o  Accel Linux 6.1

  o  postgreSQL 7.0.2

  o  JDK 1.2.2

  o  Apache 1.3.12

  o  Tomcat 3.1

  o  cocoon 1.8

  ⿡ Ұϴ ġ Apache Plugin ̴.

  3.1.  Tomcat 3.1 ġ

  1. ġ ġ   ġ DSO  ϵǾ ־
  Ѵ.

  Apache Configure   

       [root@nogadax src]$ ./configure --prefix=/usr/local/apache \
       --enable-module=most \
       --enable-shared=max
       [root@nogadax src]$ make
       [root@nogadax src]$ make install

  2. JDK1.1.x  ̻ ġǾ ־ Ѵ.

  3. http://jakarta.apache.org/downloads/binindex.html
  <http://jakarta.apache.org/downloads/binindex.html>  ̹ ϵ
  ̳ʸ Ű(jakarta-tomcat.tar.gz) ٿް mod_jserv.so 
  ٿ޴´.

  4.  丮 ̳ʸ Ű  Ǯ ġ Ϸ̴.

  3.2.  ϱ

  1. ٿ mod_jserv.so  (ġ 丮) apache/libexec
  丮 Ѵ.

  2. TOMCAT_HOME JAVA_HOME ȯ溯 Ѵ.

   tomcat  ΰ /usr/local/jakarta-tomcat ̸ /etc/profile 
  Ͽ ó Ѵ.

       export TOMCAT_HOME=/usr/local/jakarta-tomcat

  JAVA_HOME   jdk ΰ /usr/local/jdk1.2.2 ̸ 
  .

       export JAVA_HOME=/usr/local/jdk1.2.2

  ׷   ȭ Ͽ  ޸𸮷 ø ȴ.

      ( : [root@nogadax local]$  .  /etc/profile )

  3. tomcat 丮 conf 丮 ϴtomcat.conf  Ʒó
  ġ 丮  conf 丮 httpd.conf   
  ߰ϸ ȴ.

      Include  /usr/local/jakarta-tomcat/conf/tomcat.conf

  ׷  tomcat.conf Ѵ. Ʒ  ߰ϸ
  ȴ.(tomcat_test  丮)

  ApJServMount /tomcat_test /root

  tomcat.conf   webapps 丮ؿ tomcat_test 丮 
   tomcat_test 丮 WEB-INF 丮 . ׷ 
  TOMCAT_HOME/conf/web.xml   WEB-INF 丮 Ѵ.

   Tomcat 3.1 Apache1.3.12 ̸    Tomcat
  ϸ ڵ tomcat-apache.conf  ȴ. ׷ Tomcat
    tomcat.conf    tomcat-apache.conf tomcat.conf
   rename Ͽ ص ȴ.

  3.3.  Tomcat 3.1 ϱ

   tomcat   Ŀ ġ Ѵ.

  1. tomcat  tomcat  bin 丮 "tomcat.sh start" 
  "startup.sh"  Ѵ.

  2. ġ Ѵ.(apachectl start)

  3.4.  ϱ

  1. tomcat Ѵ. ට  tomcat  bin 丮
  "tomcat.sh stop"  "shutdown.sh"  Ѵ.

  2. ġ Ѵ.(apachectl stop)

  3.5.  Tomcat 3.1 ׽Ʈϱ

  ׽Ʈ URL  http://210.110.144.235 ϶  .

       http://210.110.144.235/examples/servlets

       http://210.110.144.235/examples/jsp

  3.6.  Servlet 

  Servlet    tomcat 丮  lib 丮
  "servlet.jar"   CLASSPATH  ϸ ȴ. (̿ܿ ٸ 
    Ȩ̳ Ϸ ֽø ڽϴ.)

   : export  CLASSPATH=$CLASSPATH:/usr/local/jakarta-
  tomcat/lib/servlet.jar

  ׷  servlet α׷ ϸ ȴ.

  4.  Jakarta-tomcat/conf 丮 server.xml 

  tomcatserver.xml  ߿ ȭ̴. ȭϳ ߿ ҷδ
  Server,Logger,ContextManager ,ContextInterceptor
  RequestInterceptor,Connector,Context   ߿ 
  ˾ƾ  κ Context  ƴѰ ʹ. ڰ  ҿ  ˰
    ̸ ּ κи ϰ  ̴.

  Server.xml  Context κ Web Application(Servlet̳ JSP)
  ġ Ҹ ϸ WEB  PATH() Ѵ. Ÿ ϵ
   ڵ εѴ.

   Context(webapps,work) base 丮 ContextManager 
  Home̸ TOMCAT_HOME ϰ ǹ̰ ٸ.  ContextManager  Home
   /usr/local/jakarta-tomcat ̸ ÿ Web Application  Ե
  webapps  δ /usr/local/jakarata-tomcat/webapps ̴. 
  ÿ web application(servlets,JSPs)   ִ δ
  /usr/local/jakarta-tomcat/webapps/examples/WEB-INF/classes ̴.

  Ÿ work 丮 Tomcat  ߰   ġϸ(
   ϵ JSP )  丮 Tomcat ߿ ȴٸ JSP
     ʴ´.

  Ʒ ȭ   ƴ  κи .

       <Context path="/examples" docBase="webapps/examples" debug="0" reloadable="true">
       </Context>

       <Context path="/pgsql" docBase="webapps/pgsql" debug="0" reloadable="true">
       </Context>

       <Context path="/websql" docBase="webapps/websql" debug="0" reloadable="false">
       </Context>

  Context  jserv  ͸ Ȱ ϴ ZONE   
  δ.

    examples  ÿ   tomcat  ġ  web
  󿡼 ٷ   ִ. ÿ  examples/WEB-INF/classes
   ִ.

  ÿ examples  Hello  ϱ   WEB  ּҴ
  http://your_host_address/examples/servlet/Hello ̴.

  web󿡼 examples /examples/servlet  ϴ   .

  tomcat  ۵Ǹ conf 丮 server.xml    tomcat-
  apache.conf ڵ Ѵ.   ߿ Context   PATH 
  Ͽ ڵ ϰ Ѵ. ٷ (tomcat-apache.conf)
  examples   ΰ examples/servlet  ȴ.(⿡ 
   tomcat    ϱ ٶ.)  tomcat-apache.conf
    Ŀ ġ ⵿ϸ ġ Tomcat  ڵ 
  tomcat-apache.conf  Ͽ ȴ.

  reloadable="true" Auto-reloadable ̸ false̸  ø̼
  Auto-reloadable   ʴ´.

  Ÿ pgsql  websql  ڰ ׽Ʈ   ̴.  ΰ
  丮 webapps 丮 Ͽ  丮  ٸ
   丮  Ѵ.(WEB-INF/classes)   ̴.

       webapps/pgsql/WEB-INF/classes
       webapps/websql/WEB-INF/classes

   丮 classes   Ŭ  Ǹ tomcat
   tomcat 丮 "tomcat-apache.conf"  

   pgsql  ϴ URL ̴.

       http://210.110.144.235/pgsql/servlet/example_servlet

   example_servlet  (example_servlet.class)̸ "pgsql/WEB-
  INF/classes"  ִ.

  5.  server.dtd 

     ̳ XML  õ ̹Ƿ ʵ
  ƴϴ. ִ и о ٶ.

     server.dtd   Ϻ  ƴϹǷ ִ 
  XML   ϱ ٶ.

  server.dtd XML ũ  Ÿ  DTD(Document Type
  Declarations)̸, tomcat   server.xmlϿ Ǵ
  ũ ϴ  TOMCAT_HOME/conf/server.dtd ̴. ,
  server.dtd server.xml    ϴ  Ǵ ̴.

   ũ  Ÿ ̶ ο ũ  ϴ
  ̴. , tomcat server.dtd  ǵ  Ͽ
  server.xml      ְ Ǹ,   server.dtd 
  ǵ (?) server.xml   ϰ ȴ.

        <?xml version="1.0" encoding="ISO-8859-1"?>

    XML  Ÿ.

        <!ELEMENT Server (ContextManager+)>

  Server  (element)  ϸ (ContextManager)  server 
  ҿ Եȴ. (ContextManager+)  "+" ϳ ̻ ǹϸ
  ⼭ ContextManager ̶ Ұ Server ҳ ּ ϳ
  ־ ϸ ϳ ̻ ־ ȴٴ ǹ̴.   ̴.

       example 1)

       <Server>
          <ContextManager></ContextManager>
       </Server>

       example 2)

       <Server>
          <ContextManager></ContextManager>
          <ContextManager></ContextManager>
          <ContextManager></ContextManager>
       </Server>

        <!ATTLIST Server
            adminPort NMTOKEN "-1"
            workDir CDATA "work">

  ATTLIST  Ӽ ǹϸ Server  Ӽ Ѵ. 
  ̴.

       <Server adminPort="8808" workDir="workdirect" >
          <ContextManager></ContextManager>
       </Server>

        <!ELEMENT ContextManager (Context+, Interceptor*, Connector+)>

    ContextManager   Ҹ  Ѵ. Interceptor* 
  * 0 ̻ ǹϹǷ Interceptor   ǰ ϳ ̻ ־
  ȴ.  ̴.

       <Server>
          <ContextManager>
           <Context></Context>
           <Connector></Connector>
           <Connector></Connector>
          </ContextManager>
       </Server>

        <!ATTLIST ContextManager
            port NMTOKEN "8080"
            hostName NMTOKEN ""
            inet NMTOKEN "">

     ContextManager  Ӽ  Ѵ. NMTOKEN 
  ڿ  Ƶ Ǹ XML  ̸   ѿ ¾
   Ѵ. "8080", ""   ӻ  Ʈ μ  
    츦  ̴.   ̴.

       <Server>
          <ContextManager port="8007"></ContextManager>
       </Server>

        <!ELEMENT Context EMPTY>

  Context Ҹ  Ѵ.  (EMPTY).

   <!ATTLIST Context
       path CDATA #REQUIRED
       docBase CDATA #REQUIRED
       defaultSessionTimeOut NMTOKEN "30"
       isWARExpanded (true | false) "true"
       isWARValidated (false | true) "false"
       isInvokerEnabled (true | false) "true"
       isWorkDirPersistent (false | true) "false">

  Context Ӽ Ѵ. CDATA  ڿ ǹϸ #REQUIRED 
    ־  ǹϸ (true | false)  true  false
  ߿  ;  ǹѴ.   "true"  "false" Ʈ
  ̴.    ̴.

       <Server>
          <ContextManager>
           <Context path="/test" docBase="webapps/test"></Context>
          </ContextManager>
       </Server>

        <!ELEMENT Interceptor EMPTY>

    Interceptor Ҹ Ѵ.

        <!ATTLIST Interceptor
            className NMTOKEN #REQUIRED
            docBase   CDATA #REQUIRED>

    Interceptor Ӽ Ѵ.

   

  6.  server.xml  tomcat.conf  

      Խ     Դϴ.

  server.xml  tomcat.conf  TOMCAT_HOME/conf 丮 ֽϴ.

  6.1.   1

  ***server.xml***

   <Context path="/pgsql" docBase="webapps/pgsql" debug="0" reloadable="true">
   </Context>

  ***tomcat.conf***

  Alias /pgsql  /usr/local/tomcat/webapps/pgsql

  <Directory "/usr/local/tomcat/webapps/pgsql">
     Options Indexes FollowSymLinks
  </Directory>

  ApJServMount /pgsql/servlet  /pgsql  (̺κ   )

  <Location /pgsql/WEB-INF/ >
     AllowOverride None
     deny from all
  </Location>

  /usr/local/tomcat/webapps/pgsql 丮 WEB-INF/classes 
  ׽Ʈ  ø̼ Ѵ.

  URL   : http://www.xxx.com/pgsql/servlet/xxx

  6.2.   2

       ***server.xml***

       <Context path="/test" docBase="webapps/test" debug="0" reloadable="true">
       </Context>

       ***tomcat.conf***

       Alias  /test  /usr/local/tomcat/webapps/test

       >Directory "/usr/local/tomcat/webapps/test">
        Options  Indexes  FollowSymLinks
       >/Directory>

       ApJServMount  /test  /test  (̺κ   )

       <Location /test/WEB-INF/ >
          AllowOverride  None
          deny  from  all
       </Location>

  URL   : http://www.xxx.com/test/xxx

  6.3.   3

  1. ϴ tomcat丮  conf丮server.xml ó
  մϴ.  (  κп ߰ϸ ǰ.)

       <Context path="/jj" docBase="/usr/local/apache/htdocs/jsp" debug="0" reloadable="true" >
       </Context>

  2. ׸  丮 tomcat.conf Ͽ Ʒó ְ߰.

       Alias /jj /usr/local/apache/htdocs/jsp

       <Directory "/usr/local/apache/htdocs/jsp">
          Options Indexes FollowSymLinks
       </Directory>

       ApJServMount /jj /jj

       <Location /jsp/WEB-INF/ >
          AllowOverride None
          deny from all
       </Location>

  3.   /usr/local/apache/htdocs 丮 jsp 丮 
  ǰ.  jsp  丮 webapps 丮 examples  
  ؼ 丮 ϸ   ׿.

    ׽Ʈ  examples 丮  ߰.  
  examples/jsp/dates/date.html ׽Ʈغôµ ߵǳ׿.

   http://210.1x0.xx4.xx1/jj/jsp/dates/date.html ߽ϴ.

  7.  Web Application,war,web.xml

   κ Java Servlet Specification Version 2.2  Ͽ.  
  忡 Ұ ܴ   ϱ ٶ.

  Web Application ̶ Servlet,JSP,HTML,Ÿ ̹  ڷ 
  ٸ Ÿ ϴ Web  ҽ̴.

  ̷ Web Application  Ͽ ϱ   WAR ̴.
  WAR  Web Application Archive̸ 丮 Ͽ  Ȥ
  Ű ϳ ̴.

  web.xml Deployment Descriptor ̸ XML  ˰ ִ 
  $TOMCAT_HOME/conf/web.dtd  ٶ.  web.xml Ҵ deployment
    ȯ  ̸  .

  o  ServletContext Init Parameters

  o  Session Configuration

  o  Servlet/JSP Definitions

  o  Servlet/JSP Mappings

  o  Mime Type Mappings

  o  Welcom File list

  o  Error Pages

  o  Security

  web.xml  $TOMCAT_HOME/webapps/user_app/WEB-INF 丮
  ġϸ user_app 丮 Ͽ ִ Web Application  ȯ 
  κ Ѵٰ  ȴ. ,  Web Application  ƴ Ư Web
  Application  ȯ  ϸ, WAR Ϸ Ű   
  Եȴ.

  WEB-INF 丮 web.xml ϰ classes 丮 Ÿ lib
  丮 ġѴ.  classes  丮 servlet  utility
  class  ġ   ִ.

   web.xml   丮   ش 丮 
     $TOMCAT_HOME/conf/web.xml 
  $TOMCAT_HOME/webapps/ش_丮/WEB-INF/ Ͽ Ѵ.
  web.xml  web application  ° Ѵ.

   web.dtd  web.xml    ̰ڴ.  web.dtd
   web.xml ظ   xml     ϵ ϰڴ.

   $TOMCAT_HOME/conf/web.dtd  Ϻκ̴.

       <!--(ּ) The session-timeout element defines the default session
       timeout interval for all sessions created in this web application.
       The specified timeout must be expressed in a whole number of minutes.-->
       <!ELEMENT session-timeout (#PCDATA)>
       <!ATTLIST session-timeout id ID #IMPLIED>
       ...........
       ...........
       <!--(ּ) The welcome-file-list contains an ordered list of
       welcome files elements. -->
       <!ELEMENT welcome-file-list (welcome-file+)>
       <!ATTLIST welcome-file-list id ID #IMPLIED>
       <!--(ּ) The welcome-file element contains file name to use
       as a default welcome file, such as index.html-->
       <!ELEMENT welcome-file (#PCDATA)>
       <!ATTLIST welcome-file id ID #IMPLIED>

   <!ELEMENT session-timeout (#PCDATA)> session  Ʈ Time-Out
  ð ϵ ϴ ҷμ   κ̴. (#PCDATA) ܸ
  带 ǹϸ Ʈ  ȴ.  ( xml  Ʈ ̴.)

  <!ATTLIST session-timeout id ID #IMPLIED>  session-timeout ҿ
   Ӽ  κ̴.  #IMPLIED session-timeout  id 
   ǹѴ. , <session-timeout id="123dc56"> ó Ǿ
  ϳ #IMPLIED   <session-timeout>  Ǿ ȴ.

  welcome-file  web-application  welcome-file ϸ ġ
  DocumentRoot index.html  ٰ  ȴ.  (welcome-file+) 
  welcome-file-list  ڽĳ带  ϸ "+" welcome-file Ұ
  ϳ ̻ ־ ȴٴ ǹ̴.  Ʒ web.xml   welcome-
  file-list ҳ welcome-fileҵó ټ   ִٴ
  ǹ̴.

   $TOMCAT_HOME/conf/web.xml Ϻκ̴.

       <session-timeout>
         30
       </session-timeout>
       ..........
       ..........
       <welcome-file-list>
       <welcome-file>
          index.jsp
       </welcome-file>
       <welcome-file>
          index.html
       </welcome-file>
       <welcome-file>
          index.htm
       </welcome-file>
       </welcome-file-list>

  8.  PostgreSQL  JDBC    ѱó

  8.1.  PostgreSQL  JDBC 

  Tomcat 3.1  postgreSQL JDBC  ǿܷ ϴ.  ȯ溯
  CLASSPATH  ϱ⸸ ϸ ȴ.  ׷ Tomcat  ڵ
  о JDBC  εѴ.

  CLASSPATH  

     export
  CLASSPATH=$CLASSPATH:/usr/local/pgsql7.0.2/jdbc/postgresql.jar

  8.2.  Tomcat  ѱ ó

  Tomcat  ѱó Apache-Jserv  ϴ.

  Ʒ  ҽԴϴ.

         ..............
         ..............

         public void doGet(HttpServletRequest req , HttpServletResponse res)
         throws ServletException,IOException
         {
           .......
           .......
           PrintWriter out;
           res.setContentType("text/html;charset=euc-kr");
           out=new PrintWriter(new OutputStreamWriter(
                            res.getOutputStream(),"KSC5601"));
           .......
           .......
        }
          .....
          .....
         public  void doPost(HttpServletRequest req, HttpServletResponse res)
         throws ServletException,IOException
         {
           res.setContentType("text/html;charset=euc-kr");
           PrintWriter out=new PrintWriter(new OutputStreamWriter(
                                           res.getOutputStream(),"KSC5601"));
           ....
           String id=ksc(req.getParameter("id"));
           String name=ksc(req.getParameter("name"));
           String juso=ksc(req.getParameter("juso"));
           String tel=ksc(req.getParameter("tel"));
           String memo=ksc(req.getParameter("memo"));
           ....
           ....
         }
           .....
           .....

         public String ksc(String kscstr)
         throws UnsupportedEncodingException
         {
          if(kscstr==null) return null;
          return new String(kscstr.getBytes("8859_1"),"KSC5601");
         } //  ksc() Լ ڸ KSC5601 ȯѴ.

         ............................................................

  8.3.  PostgreSQL 7.0.2's JDBC  ѱó

   Ʈ׷7.0.2 ѱ ϱ KSC5601 ȯϿ
  Ѵ.  ׷  Ʈ׷  ѱ ٷ . Ÿ
  ٸ  Ƹ  ŷ Ǹ  ׽Ʈ  Ҵ.

  Ʒó ڸ ksc()Լ ksc5601  ȯ Ŀ Ʈ׷
  insert  ϸ ȴ.

    String id=ksc(req.getParameter("id"));
    String name=ksc(req.getParameter("name"));
    String juso=ksc(req.getParameter("juso"));
    String tel=ksc(req.getParameter("tel"));
    String memo=ksc(req.getParameter("memo"));

  9.  cocoon 1.8

  Cocoon official  unofficial  Ͽ ġ  
  ִ. official ٷο ġ   ϱ  
  ̳ʸ Ű̿ ٿ޾  Ǯ ڹ Ŭ ʿ 
  縦 ϸ ȴ. ݴ unofficial ׷ ʴ.

  cocoon  XML  Web publishing  ϱ  100%  ڹ
  publishing Framework̴.  XML Ϻϰ  ʴ 
   XML    óϿ HTML  ȯϿ  
    ش.

  Cocoon1.8  ٿޱ⸦ ϸ ٿ http://xml.apache.org
  <http://xml.apache.org>  ϱ ٶ.

      ݿ Tomcat-apache  ġ ¿
  Cocoon 1.8 official   ġ  Ѵ.

  Ÿ ڰ XML  ̹Ƿ XML ü   Ұϸ
    亯 Ұϴ ϱ ٶ.

  9.1.  cocoon ġ

  1. ٿ  Cocoon 1.8 ̳ʸ Ű    Ǭ.

  2. Cocoon  bin 丮 cocoon.jar  lib 丮  *.jar
   tomcat 丮 lib 丮 Ѵ.

  3. tomcat 丮 conf 丮 ̵Ͽ server.xml Ѵ.
  Ʒ   ߰ϸ ȴ.

       <Context path="/cocoon" docBase="webapps/cocoon" debug="0" reloadable="true">
       </Context>

  4. tomcat 丮 conf 丮 tomcat.conf  
  ߰Ѵ.

  Alias /cocoon $TOMCAT_HOME/webapps/cocoon
  <Directory "$TOMCAT_HOME/webapps/cocoon">
    Options Indexes FollowSymLinks
  </Directory>
  ApJServMount /cocoon /cocoon
  <Location /cocoon/WEB-INF/ >
    AllowOverride None
    deny from all
  </Location>

  5. Ʒ ó tomcat 丮 webapps 丮 丮
  .

       mkdir $TOMCAT_HOME/webapps/cocoon
       mkdir $TOMCAT_HOME/webapps/cocoon/WEB-INF

  6. Ʒ ó cocoon ҽ 丮  web.xml ϰ
  cocoon.properties   Ѵ.

       cp  cocoon_ҽ_Ǭ_丮/src/WEB-INF/web.xml $TOMCAT_HOME/webapps/cocoon/WEB-INF
       cp  cocoon_ҽ_Ǭ_丮/conf/cocoon.properties $TOMCAT_HOME/webapps/cocoon/WEB-INF

  7.  web.xml Ѵ.

       <init-param>
       ...
       <param-value>[path-to-cocoon]/conf/cocoon.properties</param-value>
       ...

   κп <param-value>[path-to-cocoon]/conf/cocoon.properties 
  <param-value>/WEB-INF/cocoon.properties  Ѵ.

  8.  Ʒ ó cocoon ҽ 丮 samples 丮
  tomcat 丮ַ Ѵ.

       cp  cocoon_ҽ_Ǭ_丮/samples $TOMCAT_HOME/webapps/cocoon/servlets

  9.2.  cocoon ׽Ʈ

  cocoon   ġ   .  ׽Ʈ  tomcat 
  apache ⵿  Ʒ ó  url  ԷѴ.

       http://localhost/cocoon/Cocoon.xml
       http://localhost/cocoon/servlets/index.xml

   Cocoon.xml  ũ ϴ   ƴ϶ 
   ׽Ʈ  ϴ ̴ ϱ ٶ.

  ׽Ʈ     ٽ ѹ Ȯϱ ٶ, Ÿ,
  tomcat ⵿ tomcat  lib 丮 ִ xerces.jar  Ŭ ε
   xml.jar   εϱ  xml.jar  zxml.jar  rename
  ϵ .

   ڼ  http://xml.apache.org <http://xml.apache.org> 
  ϱ ٶ.

  10.  Cocoon 1.8 Ÿ

  10.1.  Cocoon 1.8  euc-kr Encoding

  cocoon ѱ   $TOMCAT_HOME/webapps/cocoon/WEB-
  INF/cocoon.properties ؾ Ѵ.  vi  cocoon.properties 
  XML Formatters κп ִ HTML 4.0(strict) κ ϸ ȴ.
   ̴.

       # HTML 4.0 (strict)
       formatter.text/html.doctype-public = ...
       formatter.text/html.doctype-system = ...

   κ ãƼ Ʒ  ߰ϸ ȴ.

  formatter.text/html.encoding = euc-kr

  , ó ߰ϸ ȴ.

       # HTML 4.0 (strict)
       formatter.text/html.doctype-public = ...
       formatter.text/html.doctype-system = ...
       formatter.text/html.encoding = euc-kr

   ѱ  ذϱ  û  ߴ. ġ 
  Ʈ ϸ Ʈ ãƺ formatter.text/html/loose κ
  ϶  ־ ε..

  Ȥ ̺κп  ٸ ̳  ˰ ִٸ 
  (nogadax@kldp.org)  ־ Ѵ.

  10.2.   xml 

  ̺ ׷   κ ƴϴ. ڰ   
  ־ ׳ ÷  ̹Ƿ ִ и ϱ ٶ.

  Ʒ  ׽Ʈϱ  $TOMCAT_HOME/webapps/cocoon/servlets/ngd
  丮 .  ׽Ʈ  ۼ  ΰ̸ ngd-
  book.xml  ngd-book.xsl ̴. ngd-book.xml  xml ̸ ngd-
  book.xsl  xml   ÷ϱ  ̴.

  ׽Ʈ  URL http://210.110.1xx.xx6/cocoon/servlets/ngd/ngd-
  book.xml ̴.

    ̴.

       <?xml version="1.0" encoding="euc-kr"?>
       <?xml-stylesheet href="ngd-book.xsl" type="text/xsl"?>
       <?cocoon-process type="xslt"?>
       <!DOCTYPE ngd-book [
        <!ELEMENT ngd-book (title?, name, dt, abstract, sect1)>
        <!ELEMENT title (#PCDATA)>
        <!ELEMENT name (#PCDATA)>
        <!ELEMENT dt (#PCDATA)>
        <!ELEMENT abstract (#PCDATA)>
        <!ELEMENT sect1 (#PCDATA)>
       ]>

       <ngd-book>
        <title>Hello</title>
        <name>nogadax</name>
        <dt>/2000/11/11</dt>
        <abstract>Tomcat The Jakarta Project 깰̸ Ȩ
        http://jakarata.apache.org ̴. Jakarta Project ǥ
         ҽȭǾ ߵ Java ÷  Ͽ  ǰ
         ַ ϱ ̴. Ÿ XML  Ű
        cocoon  Ȩ  http://xml.apache.org̴. Cocoon
        XML   óϿ ̸  ִ
        Ű ġ ϴ.
        </abstract>
        <sect1>
        Tomcat The Jakarta Project 깰̸ Ȩ
        http://jakarata.apache.org ̴. Jakarta Project ǥ
         ҽȭǾ ߵ Java ÷  Ͽ  ǰ
         ַ ϱ ̴. Ÿ XML  Ű
        cocoon  Ȩ  http://xml.apache.org̴. Cocoon XML
          óϿ ̸  ִ
        Ű ġ ϴ.
        </sect1>
       </ngd-book>

       <?xml version="1.0" encoding="euc-kr"?>
       <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

         <xsl:template match="ngd-book">
          <xsl:processing-instruction name="cocoon-format">type="text/html"</xsl:processing-instruction>
          <html>
           <head>
            <title>
             <xsl:value-of select="title"/>
            </title>
           </head>
           <body bgcolor="#ffffff">
             <xsl:apply-templates/>
           </body>
          </html>
         </xsl:template>

         <xsl:template match="title">
          <h2>
           <xsl:apply-templates/>
          </h2>
         </xsl:template>

         <xsl:template match="name">
           <h3>
             <xsl:apply-templates/>
           </h3>
         </xsl:template>

         <xsl:template match="dt">
           <h4>
             <xsl:apply-templates/>
           </h4>
         </xsl:template>
         <xsl:template match="abstract">
           <hr/>
           <p>
           <i>
             <xsl:apply-templates/>
           </i>
           </p>
           <hr/>
         </xsl:template>
         <xsl:template match="sect1">
           <p>
             <xsl:apply-templates/>
           </p>
         </xsl:template>

       </xsl:stylesheet>

  11.  Tomcat 3.2.1 ġ

  Tomcat 3.2  ũ ΰ  ġ  ִ. mod_jserv 
  ̿ ġ mod_jk  ̿ ġ ִ. ΰ   ġ
  Ұϸ   ġǾ Ѵ.

  11.1.  Tomcat 3.2.1(mod_jserv,Ajpv12)

  A. ġ ȯ   

        - wow linux 6.2
        - Tomcat 3.2.1
        - Apache 1.3.14
        - JDK 1.2.2
        - Ʒ  ̴.
          a. Apache  JDK   ġǾ ־ Ѵ.
          b. Ʒ ġ mod_jserv  ġ̴.
          c. Ĺ 3.2  3.1 ġ ٸ  ִ.
          d.   Ĺ 4.0  ġ ٸ  ִ.

  B. ġ

  B-1

   -Tomcat 3.2.1  ̳ʸ  ҽ   ٿ ޴´.
   -http://jakarta.apache.org  ٿ޴´.

  B-2

   -Ĺ ̳ʸ  /usr/local  ..
   -ҽ  /usr/local/src 丮  Ǭ.
   -jakarata-tomcat-3.2.1.tar.gz   Ʒó ..
   - "tar -zxvf jakarta-tomcat-3.2.1.tar.gz"Ͽ  

  B-3

   -/usr/local/src/jakarta-tomcat-3.2.1-src/src/native/apache/jserv ̵
   - "apxs -c -o mod_jserv.so *.c" Ͽ mod_jserv.so .

  B-4

   - mod_jserv.so APACHE_HOME/libexec  copy Ѵ.
   - : "APACHE_HOME"  ġ ġ 丮

  B-5

   -APACHE_HOME/conf/httpd.conf   ο   ߰
   - Include /usr/local/jakarata-tomcat/conf/tomcat.conf

  B-6

   -/etc/profile  JAVA_HOME  TOMCAT_HOME ȯ  .
   -Tomcat  bin  ȯ  PATH  .
   -  ̴.
   - JAVA_HOME=/usr/local/jdk
   - TOMCAT_HOME=/usr/local/tomcat
   - PATH=$PATH:/usr/local/tomcat/bin
   - export JAVA_HOME TOMCAT_HOME PATH

  B-7

   -/etc/profile  ϴ (: . /etc/profile)
   -α׾ƿ  ٽ α

  B-8

   -tomcat.sh start Ͽ Ĵ ⵿Ѵ.
   -ġ  Ĺ ⵿Ͽ .
  B-9

   -TOMCAT_HOME/conf/tomcat.conf ٸ ̸   Ȥ copy
   -TOMCAT_HOME/conf/tomcat-apache.conf  tomcat.conf copy Ѵ.

  B-10

   - apachectl start Ͽ ġ ⵿Ѵ.
   -ġ ⵿ϸ鼭 httpd.conf   а tomcat.conf
    ϰ ȴ.
   -ġ ⵿   ٿ  ׽ƮѴ.
   - http://MY-URL/examples/jsp
   - http://MY-URL/examples/servlets

  11.2.  tomcat.conf  (Tomcat 3.2.1)

  TOMCAT_HOME/conf  ϴ tomcat.conf  Ĺ ⵿ 
  ڵ Ǵ tomcat-apache.conf Բ ϴ ġ 
  Ĺ  ȯ  κ Ѵ.

  ⺻ jserv   ȯ  þ ǹǷ web-server-
  plugin ߿ mod_jserv  ϸ Ʈ ݷδ Ajpv12 
  ϸ Ʈ Ʈδ 8007 Ѵ.

  Tomcat ⵿ overwrite Ǿ ڵ Ǵ tomcat-apache.conf
  Ŀ͸¡ ϹǷ  tomcat-apache.conf tomcat.conf
  Ͽ tomcat.conf  ϸ ϴ    ϴ.
   tomcat-apache.conf Ͽ ū    ...

  ################################################
  #                                              #
  #  TOMCAT_HOME/conf/tomcat.conf (2001,01,08)   #
  #                                              #
  ################################################

  #tomcat.conf  ġ httpd.conf 
  # ġ  .
  #ġ mod_jserv νϵ..
  LoadModule jserv_module libexec/mod_jserv.so

  #mod_jserv ⿡  
  <IfModule mod_jserv.c>

  #mod_jserv 
  ############################
  # Do not Edit!
  ############################
  #ġ Ĺ ڵ  ϹǷ manual on
  ApJServManual on

  #ġ Ĺ ſ  Ʈ  (ajpv12)
  ApJServDefaultProtocol ajpv12

  #mod_jserv  Ű ȵ DISABLED  ..
  ApJServSecretKey DISABLED

  # ȣ Ʈ 
  ApJServMountCopy on

  #Log Level (ٸ  : emerg,warn,crit,debug,,)
  ApJServLogLevel notice
  ############################

  #ƮȣƮ  Ʈ 
  #ġ  ȣƮ(The same machine)̸ localhost
  ApJServDefaultHost localhost

  #ġ Ĺ  Ʈ Ʈ 
  ApJServDefaultPort 8007

  #ġ jsp Ȯڸ νĽŰ ..
  AddType test/jsp .jsp

  #jsp Ȯڿ  ó Ĺ ..
  AddHandler jserv-servlet .jsp

  #Alias  ġ   丮  .
  #Static file(HTML,Image ) ġ óϵ .
  #http://MY-URL/examples Ĺ ƴ ġ ó
  Alias /examples "/usr/local/tomcat/webapps/examples"

  #ġ ó  丮  丮  
  <Directory "/usr/local/tomcat/webapps/examples">
   Options Indexes FollowSymLinks
  </Directory>

  #Ĺ  URL-PATH    ɼ
  #http://MY-URL/examples/servlet/my_classes
  # Ʒ Ʈɼǰ   ̴.
  #ApJServMount /examples/servlet ajpv12://localhost:8007/examples
  ApJServMount /examples/servlet /examples

  #Ȼ ߿ WEB-INF 丮  ȣ 
  # META-INF Ȱ ϸ ..
  <Location "/examples/WEB-INF/">
   AllowOverride None
   deny from all
  </Location>

  ..........
  ..........
  </IfModule>
  </verb></tscreen>

  11.3.  Tomcat 3.2.1 (mod_jk.so, Ajp13)

  mod_jk.so mod_jserv.so   ۼ web-server-plugin̴.
  web-server-plugin̶ ġ  Ĺ  ϴ
  μ  Ʈ Ư  ̿Ͽ  Ĺ 
  Ѵ.

     ġ   ޵ Ŭ̾Ʈ
   û Ĺ ޵   Ĺ ó  ġ
     ְ Ѵ.

   Ĺ̿   䱸Ǵ  Ʈȣ 
   Ÿ ȣƮ  ̴. ȣƮ   
  tomcat.conf ApJServDefaultHost .

  mod_jk ϴ ݷδ ũ ΰ  Ajpv12  Ajpv13
   ִ.

  A. ġȯ  ǻ

        - wow linux 6.2
        - Tomcat 3.2.1
        - Apache 1.3.14
        - JDK 1.2.2
        -  ǻ̴.
          a. Apache  JDK   ġǾ ־ Ѵ.
          b. Ʒ ġ mod_jk  ġ̴.
          c. Ĺ 3.2  3.1 ġ ٸ  ִ.
          d.   Ĺ 4.0  ġ ٸ  ִ.

  B. ġ

  B-1

   -Ĺ 3.2.1 ̳ʸ  ҽ   ٿ޴´.
   -http://jakarta.apache.org  ٿ޴´.

  B-2

   - Ĺ mod_jserv ġߴٸ
   -mod_jserv     
   -httpd.conf  Include /usr/local/tomcat/conf/tomcat.conf  

  B-3

   -Ĺ ̳ʸ  /usr/local/ 
   -ҽ  /usr/local/src/   Ǭ.
   -jakarata-tomcat-3.2.1.tar.gz   Ʒó ..
   -"tar -zxvf jakarta-tomcat-3.2.1.tar.gz"Ͽ  

  B-4

   -mod_jk.so  ϱ  ó  ҽ 丮 ̵.
   -"cd /usr/local/src/jakarta-tomcat-3.2.1-src/src/native/apache1.3"
     (or apache2.0)
   -"apxs -o mod_jk.so -I../jk -I/usr/local/jdk/include
     -I/usr/local/jdk/include/linux -c *.c ../jk/*.c"
   -   ٿ Է  .
   -JDK PATH  ڽ JDK ο °..
   - mod_jserv.so  APACHE_HOME/libexec/ copy Ѵ.
   -APACHE_HOME ڽ ġ 丮 .

  B-5

   -/etc/profile TOMCAT_HOME  JAVA_HOME  Ĺ bin  
   -  ̴.
   - JAVA_HOME=/usr/local/jdk
   - TOMCAT_HOME=/usr/local/tomcat
   - PATH=$PATH:/usr/local/tomcat/bin
   - export JAVA_HOME TOMCAT_HOME PATH

  B-6

   -/etc/profile  ϴ (: . /etc/profile)
   -α׾ƿ  ٽ α

  B-7

   -Ajpv13 
   -TOMCAT_HOME/conf/server.xml    Ajp12   κп ߰
   -<Connector className="org.apache.tomcat.service.PoolTcpConnector">
      <Parameter name="handler"
      value="org.apache.tomcat.service.connector.Ajp13ConnectionHandler"/>
      <Parameter name="port" value="8009">
    </Connector>
   - Ajpv12    κ ״ д.
   -Ajpv12  κ Ĺ ῡ  κ ϱ ̴.
   - stand-alone 尡 ƴϹǷ http   κ ּó ϴ.

  B-8

   -ġ httpd.conf  ߰
   -Include /usr/local/jakarta-tomcat/conf/mod_jk.conf-auto

  B-9

   -TOMCAT_HOME/conf/workers.properties ϱ
   -Ǿ ׸  3̴.
   -workers.tomcat_home, workers.java_home, ps
   -workers.tomcat_home  ó
   -workers.tomcat_home=/usr/local/jakarta_tomcat
   -workers.java_home ó
   -workers.java_home-/usr/local/jdk
   -ps  ó
   -ps=/
   -    ڽſ °  Ѵ.

  B-10

   -  ȮѴ.
   -tomcat.sh start
   -apachectl start
   - ٿ URL â ó Է
   -http://MY-URL/examples/jsp

  11.4.  stand-alone 

  server.xml  Ͽ stand-alone   connector κ
  ּ óϰų Ͽ ϴ. ƴ ϴ   
  ϴ.  AJPV13  ϴ AJPV12   Connector
  κ  ϸ ȵȴ. Ajpv12 Connector κ Tomcat 
  Shutdown  ϱ ̴.

   server.xml  stand-alone  operation  HTTP Connection
  κ̴.  ׳ ϱ ٶ.

       <Connector className="org.apache.tomcat.service.PoolTcpConnector">
        <Parameter name="handler"
          value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
        <Parameter name="port"
          value="8080"/>
       </Connector>

  12.  Thread Pool  (Tomcat3.2.1)

  12.1.  Thread   

  Tomact  multi-thread  servlet containerμ ̴ Ŭ̾Ʈ
   û 忡   ǹѴ. Tomcat 3.2 
   Ŭ̾Ʈ  û  , 尡 Ǿ
   û óϰ Ͽ. ̷   ϸ Ű 
  ߱ϸ, ̷   .

  *  û  带 ϰ Ҹϴ  OS JVM
  ʿ  δ Ȱش.

  * ÿ  ̻ ټ û   ҽ(CPU  ޸
  ڿ ) Ҹ   ƴ. ,   ٿǰų
  Ÿ  ٹ û ó   ߱  ִ.

  12.2.    ذå

  ̷   ذåδ Thread Pool ϴ ̸
  Tomcat3.2 ʹ ƮĹ ü Thread Pool  Ѵ. 
  Ĺ Thread Pool   ̴.

       a.  û  带 Ͽ ϰ   ؼ 
           ֵ  带 "open" ·  ϸ ̸ 
          . ǰ ִ  Ҹ ʰ  "open" · 
          ǰ ִٰ ٸ û  ǰ ִ 带 Ͽ
          ش û óϵ Ѵ. ٽ û óϰ   
           Ǿ Ǿ   ٸ û ٸ.

       b. ̷   û  带 ϰ   ҸǴ
          ݺ  Żϰ ϸ, ݺ    Ҹ
           ߱Ǵ  ذѴ.

       c. Tomcat 3.2 ʹ Tomcat Admin  server.xml Ͽ Thread
          Pool      ذ  ֵ ϸ, ڽ
          Ʈ µ   ׵   ְ Ѵ.

       d. ÿ   ִ  Ѽ, idle  忡 
          ִ    Ĺ ⵿  ּ   
            ִ.

  12.3.  Thread Pool  

   server.xml Thread Pool Ʈ  κ̴.

       <Connector className="org.apache.tomcat.service.PoolTcpConnector">
        <Parameter name="handler"
         value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
        <Parameter name="port"
         value="8007"/>
       </Connector>

   κ Ʈ  Ǯ   κ̴.   
  ƹ͵ 𸣰  Ǯ   Ǹ ٷ Ʈ 
  õȴ.

  Ʈ   밡 尡 50 (max_threads) ̸, idle
   尡 25 ̸̻ (max_spare_threads) ̸  
  ϰ,  Ǯ  10  (min_spare_threads) · ϸ
  ּ 10  ̻ ϰ Ѵ.

   idle   պ  ִ μ,  
  𸣴 û    ̴. ̷ 鵵
   μ Ǿ .

  Ĺ ⵿  "ps -aux"  غ.   Ĺ  ̴.

   Thread Pool   ̴.

       <Connector className="org.apache.tomcat.service.PoolTcpConnector">
        <Parameter name="handler"
         value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
        <Parameter name="port"
         value="8007"/>
        <Parameter name="max_threads"
         value="30"/>
        <Parameter name="max_spare_threads"
         value="20"/>
        <Parameter name="min_spare_threads"
         value="5"/>
       </Connector>

  13.  Tomcat Workers

  Ĺ Ŀ(Tomcat worker)  Ͽ Ŭ̾Ʈ û
   ϱ    νϽ(Instance)μ,  ϸ
   û  Ĺ μ̴.

  , ġ   Ͽ Ŭ̾Ʈ  û Ĺ
  μ(Worker) Ͽ û ó  ְ Ѵ. ٷ ̷
  μ Ŀ̴.  Ŀ  ĿӸ ƴ϶ Ư 
    óϱ   Ŀ   ִ.

   ,  ڵ    ۾ ϰ  
  ȯ   ٸ Ĺ Ŀ   ٸ context 
  񽺵Ǳ  찡  ̰,  ȣ ü  ڽ
     ȣ ó   ٸ Ŀ ϰ  
    ̴.  ,   л ó ϴ load
  balancing  쵵  ̴.

  ̷   Ŀ ʿ ̸ ̷ Ŀ
  TOMCAT_HOME/conf/workers.properties     ִ.

  13.1.  Ŀ ϱ

  ⿡   ϰ ڼ    ϱ
  ٶ.   Tomcat3.2.1  ҽ ̳ ̳ʸ  doc
  丮 ϹǷ ϱ ٶ.

  ⺻ TOMCAT_HOME/conf/workers.properties Ͽ  3
  ׸ ãƼ ϸ  ۵Ѵ.

  o  workers.tomcat_home

  o  workers.java_home

  o  ps

    

       workers.tomcat_home=/usr/local/tomcat_321
       workers.java_home=/usr/local/jdk_122
       ps=/

  13.2.  Ŀ Ÿ

   Ŀ Ÿ ̴.

  ajp12 : ajpv12  Ͽ  û Out-process Ĺ
  Ŀ  ƴ Ŀ̴. , ajpv12  ϴ Out-
  process Ĺ worker  ϴ Ŀ Ÿ̴.

  ajp13 : ajpv12  Ͽ  û Out-process Ĺ
  Ŀ  ƴ Ŀ̴.

  jni : jni Ͽ  û In-process Ĺ Ŀ 
  ƴ Ŀ̴.

  lb : Load-balancing Ŀ̴.  Ŀ    뵵
    κ  load-balancing  óϴ Ŀ̴.

  Ŀ  

  worker.local.type=ajp12 : Ĺ μ û ϱ  ajp12
   ϴ local Ŀ

  worker.fast.type=jni : Ĺ μ û ϱ  jni 
  ϴ fast  Ŀ

  13.3.  Ÿ

   ڽ  ڽ  workers.properties .

      ϰ ִ.

  o  localhost  ȣƮ 8007  Ʈ ϴ ajp12 Ŀ

  o  localhost  ȣƮ 8009  Ʈ ϴ ajp13 Ŀ

  o  jni worker

  o  ajp12  ajp13 Ŀ  load balancing ϴ lb Ŀ

  ajp12,ajp13  lb Ŀ  ٸ  ٷ   ,
  jni Ŀ  workers.tomcat_home,workers.java_home  ps  
  Ͽ ϸ Ÿ   Ͽ Ѵ.

  14.  Ÿ 

  TOMCAT_HOME/doc 丮 ϱ ٶ.

   ׵

       -JDBC Realm
       -Configuring for Multiple Tomcat JVMs In A Minimalistic User's Guide
       -Configuring Virtual Hosting In a Minimalistic User's Guide
       -Using the Java SecurityManager with Tomcat
       -Tomcat workers.properties
       -Tomcat and SSL

    TOMCAT_HOME/doc  ִ  Ͽ.

    .

       -JDBC Realm
       -Configuring for Multiple Tomcat JVMs In A Minimalistic User's Guide
       -Configuring Virtual Hosting In a Minimalistic User's Guide
       -Using the Java SecurityManager with Tomcat
       -Tomcat workers.properties
       -Tomcat and SSL
       -Release Notes for tomcat
       -Working with mod_jk
       -Tomcat_apache HOWTO
       -Developing application with tomcat
       -Faq on Tomcat

  ޵  κе鿡 ؼ

            κ   ׵ ãƺ ٶ
        ۼ Ĺ 3.1(KLDP DSN ..) ϱ ٶ.

