´ÙÀ½ ÀÌÀü Â÷·Ê

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>


´ÙÀ½ ÀÌÀü Â÷·Ê