Æí¸®ÇÑ È£½ºÆà ¹Ì¼ÒIDC

   
 
 
 

      1Â÷ ³×ÀÓ¼­¹ö :
      ns1.misoidc.com
      101.79.73.101

      2Â÷ ³×ÀÓ¼­¹ö :
      ns2.misoidc.com
      101.79.73.105

      ¾îÁ¦ : 787 ,¿À´Ã : 78
      Àüü : 1,243,073


     

 

 
ÀÛ¼ºÀÏ : 11-11-17 17:24
mod_jk¸¦ ÀÌ¿ëÇÑ Apache2 + Tomcat5.5 ¿¬µ¿ ¹× °¡»óÈ£½ºÆÃ
 ±Û¾´ÀÌ : ½ÑÀ¥È£½ºÆÃ
Á¶È¸ : 58,528  

³»¿ë¿¡ µé¾î°¡±â¿¡ ¾Õ¼­


Âü°í »çÀÌÆ® : Configuring Tomcat5 and Apache2 with Virtual Hosts using mod_jk

Apache2¿Í Tomcat5.5µîÀÇ ¼³Ä¡´Â ÀÌ°÷¿¡¼­ ´Ù·çÁö ¾Ê½À´Ï´Ù.
¾ÆÆÄÄ¡¿Í ÅèĹ °¢°¢ ¾î´ÀÁ¤µµ ¼³Á¤ÇÒ ¼ö ÀÖ´Ù¸é ÀÌ ¹®¼­ÀÇ ³»¿ëÀº ¾î·ÆÁö ¾Ê½À´Ï´Ù.
°³Àθ¶´Ù ¼³Á¤µéÀÌ Á¶±Ý¾¿ ´Ù¸£¹Ç·Î ¹«ÀÛÁ¤ ¶È°°ÀÌ µû¶óÇϱ⠺¸´Ù´Â °æ·Î¿¡ ÁÖÀÇÇϸç ÀÚ½ÅÀÇ ¼³Á¤¿¡ ¸Â°Ô Àû¿ëÇØ¾ß ÇÕ´Ï´Ù.

ÅèĹ°ú ¿¬µ¿¿¡ ÇÊ¿äÇÑ mod_jk(mod_jk2°¡ ¾Æ´Ô)¶ó´Â ¾ÆÆÄÄ¡¿ë ¸ðµâÀ» ¼³Ä¡ÇÕ´Ï´Ù.
¸ðµâÀ» ¼³Ä¡ÇÏ´Â ¹æ¹ýÀº ´Ù¾çÇϹǷΠ¾ÆÆÄÄ¡¿ë ¸ðµâÀ» ¼³Ä¡ÇÏ°í ·ÎµåÇÏ´Â ¹æ¹ýÀº µû·Î ´Ù·çÁö ¾Ê°Ú½À´Ï´Ù.
¿ìºÐÅõ¶ó¸é apt·Î °£´ÜÈ÷ ¼³Ä¡ÇÒ ¼ö ÀÖ½À´Ï´Ù.

ÀÌ ¹®¼­¿¡¼­ ¾ÆÆÄÄ¡¼³Á¤ÆÄÀÏ, ÅèĹ, mod_jkÀÇ °æ·Î´Â ¾Æ·¡¿Í °°½À´Ï´Ù.
¾ÆÆÄÄ¡¼³Á¤ÆÄÀÏ : /etc/apache2/
ÅèĹ : /usr/lib/apache-tomcat
mod_jk : /usr/lib/apache2/modules/mod_jk.so

workers.properties ÆÄÀÏ ¸¸µé±â


workers.properties ¶ó´Â ÆÄÀÏÀ» Àû´çÇÑ °÷¿¡ »ý¼ºÇÏ°í ¾Æ·¡¿Í °°Àº Äڵ带 ³Ö½À´Ï´Ù.
ÀÌ°÷¿¡¼­´Â /etc/apache2/workers.properties ·Î »ý¼ºÇß½À´Ï´Ù.

#¾Æ·¡ÀÇ µÎ ¼³Á¤ÀÇ °æ·Î´Â Àڽſ¡ ¸Â°Ô ¼öÁ¤ÇÕ´Ï´Ù.
workers.tomcat_home=/usr/lib/apache-tomcat
workers.java_home=/usr/lib/jvm/java-6-sun

ps=/

#¾Æ·¡ ¹Ýº¹µÇ´Â worker1 ´ë½Å ´Ù¸¥ À̸§µµ »ó°ü¾ø½À´Ï´Ù.
worker.list=worker1

worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor=1

worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=worker1

worker.inprocess.type=jni
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar
worker.inprocess.cmd_line=start
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)lib$(ps)
i386$(ps)classic$(ps)libjvm.so

worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr


ÅèĹÀÇ server.xml ¼öÁ¤


ÅèĹ/conf/server.xml ¿¡ ¾Æ·¡ÀÇ Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
Server ÅÂ±× ¹Ù·Î ¾Æ·¡ÂÊ¿¡ Listener űװ¡ ÀûÈù°÷¿¡ Ãß°¡ÇÏ¸é µË´Ï´Ù.
modjk¿Í workersConfigÀÇ °æ·Î¿¡ ÁÖÀÇÇؼ­ Àڽſ¡ ¸Â°Ô ¼öÁ¤ÇÕ´Ï´Ù.
<Listener className="org.apache.jk.config.ApacheConfig" modJk="/usr/lib/apache2/modules/mod_jk.so" workersConfig="/etc/apache2/workers.properties" />


ÅèĹÀ» Àç½ÃÀÛ ÇÕ´Ï´Ù.
$ cd /usr/lib/apache-tomcat/bin
$ ./shutdown.sh
$ ./startup.sh

¿¡·¯¾øÀÌ Àç½ÃÀÛ µÇ¸é ¾Æ·¡¿Í °°Àº ÆÄÀÏÀÌ »ý¼ºµË´Ï´Ù.
/usr/lib/apache-tomcat/conf/auto/mod_jk.conf

apache2.conf ¼öÁ¤


/etc/apache2/apache2.conf ¼³Á¤ ÆÄÀÏ¿¡ ¾Æ·¡ÀÇ Äڵ带 Ãß°¡ÇÕ´Ï´Ù. Ç×»ó °æ·Î¿¡ ½ÅÁßÇϼ¼¿ä.
Include /usr/lib/apache-tomcat/conf/auto/mod_jk.conf
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"

# Globally deny access to the WEB-INF directory
<LocationMatch '.*WEB-INF.*'>
AllowOverride None
deny from all
</LocationMatch>


À§ÀÇ Äڵ忡¼­ LocationMatch '.*WEB-INF.*' ºÎºÐÀÌ Áß¿äÇÕ´Ï´Ù.
jsp¿¡¼­ WEB-INFÀÇ ³»¿ëÀº ¿©·¯°¡Áö ¼³Á¤À» °®°íÀÖ´Â Áß¿äÇÑ ºÎºÐÀ̹ǷΠº¼ ¼ö ¾øµµ·Ï ¸·¾Æ³õ½À´Ï´Ù.

VirtualHost ¼³Á¤ ÆÄÀÏ ¼öÁ¤


ÀÌ ¹®¼­´Â /etc/apache2/sites-available/default ÆÄÀÏ¿¡ VirtualHost°¡ ¼³Á¤µÇ¾î ÀÖ½À´Ï´Ù.
ÆÄÀÏÀ» ¿­¾îº¸¸é <VirtualHost *> ºÎºÐÀÌ ÀÖ½À´Ï´Ù.

ÀÌ ºÎºÐÀÇ DocumentRoot¸¦ ¼öÁ¤ÇÕ´Ï´Ù.(°æ·ÎÁÖÀÇ)
DocumentRoot /usr/lib/apache-tomcat/webapps/ROOT

±×¸®°í ¾Æ·¡ÀÇ Äڵ带 VirtualHost ű׻çÀÌ¿¡ Ãß°¡ÇØÁÝ´Ï´Ù.(worker1¿¡ ÁÖÀÇ)
JkMount /*.jsp worker1

JkMount´Â ÆÐÅÏ¿¡ ÇØ´çÇÏ´Â ÆÄÀÏ ¶Ç´Â µð·ºÅ丮¸¦ ÅèĹÀÌ Ã³¸®Çϵµ·Ï ÇÏ´Â ¼³Á¤ÀÔ´Ï´Ù.

ÆÄÀÏÀ» ÀúÀåÇÏ°í ¾ÆÆÄÄ¡¸¦ Àç½ÃÀÛ ÇÕ´Ï´Ù.
ºê¶ó¿ìÀú¿¡¼­ http://127.0.0.1·Î Á¢¼ÓÇßÀ»¶§ ÅèĹ ÆäÀÌÁö°¡ º¸ÀÌ¸é ¿¬µ¿µÈ °ÍÀÔ´Ï´Ù.

ÅèĹÀÇ context ¹®Á¦Á¡


ÅèĹÀÇ context°¡ ¹®Á¦°¡ µÉ ¼ö ÀÖ½À´Ï´Ù.
ÄÁÅؽºÆ®ÀÇ °æ·Î´Â DocumentRootÀÇ ÇÏÀ§µð·ºÅ丮ÀÎ °ÍÀÌ ¾Æ´Ï±â ¶§¹®ÀÔ´Ï´Ù.
¾ÆÆÄÄ¡ÀÇ Alias ¼³Á¤À» ÅëÇØ ¹®Á¦¸¦ ÇØ°á ÇÒ ¼ö ÀÖ½À´Ï´Ù.
ÅèĹÀÇ adminÀ» ¿¹·Î µé¸é ¾Æ·¡¿Í °°½À´Ï´Ù.

Alias /admin/ "/opt/tomcat/server/webapps/admin/"

JkMount /admin worker1
JkMount /admin/* worker1

°¡»óÈ£½ºÆÃ


¾ÆÆÄÄ¡, ÅèĹ °¢°¢ÀÇ °¡»óÈ£½ºÆà ¼³Á¤¿¡ ´ëÇؼ­ ÀÚ¼¼È÷ ´Ù·çÁö´Â ¾Ê°Ú½À´Ï´Ù.
¾ÆÆÄÄ¡, ÅèĹ µÎ°³ÀÇ °¡»óÈ£½ºÆà ¼³Á¤ÀÌ ÀÏÄ¡ÇØ¾ß ¿¬µ¿¿¡ ¹®Á¦°¡ ¾ø½À´Ï´Ù.

¾ÆÆÄÄ¡ÀÇ °¡»óÈ£½ºÆÃ
<VirtualHost test.ani>
DocumentRoot /var/www/test
JkMount /*.jsp worker1
</VirtualHost>

ÅèĹÀÇ °¡»óÈ£½ºÆÃ(server.xml)
<Host appBase="/var/www/test" name="test.com">
<Context path="" docBase="" debug="0" reloadable="true"/>
</Host>


 
 

Total 78
¹øÈ£ Á¦   ¸ñ ±Û¾´ÀÌ ³¯Â¥ Á¶È¸
48 ¿À¶óŬ ij¸¯ÅÍ ¼Â(CHARACTER SET) º¯°æÇϱâ(9i) ½ÑÀ¥È£½ºÆà 11-29 25860
47 Alteon L4½ºÀ§Ä¡ configuration ÃʱâÈ­ ¹× Dump ÀýÂ÷ ½ÑÀ¥È£½ºÆà 11-28 107227
46 ¿À¶óŬ Æú´õ ÆÛ¹Ì¼Ç ½ÑÀ¥È£½ºÆà 11-18 20218
45 mod_jk¸¦ ÀÌ¿ëÇÑ Apache2 + Tomcat5.5 ¿¬µ¿ ¹× °¡»óÈ£½ºÆà ½ÑÀ¥È£½ºÆà 11-17 58529
44 ¾ÆÆÄÄ¡1 ÅèĹ5 ½ÑÀ¥È£½ºÆà 11-16 59880
43 [CentOS] Tomcat 7.0.4 ¼³Ä¡ (¼öÁ¤1) ½ÑÀ¥È£½ºÆà 11-16 52679
42 Install Tomcat 7 on CentOS, RHEL, or Fedora ½ÑÀ¥È£½ºÆà 11-15 110125
41 ¿î¿µÀÚ°³ÀÎÀÚ·á ½ÑÀ¥È£½ºÆà 11-06 6
40 ¿À¶óŬ °èÁ¤»ý¼º ½ÑÀ¥È£½ºÆà 11-02 35597
39 ¾ÆÆÄÄ¡ À¥¼­¹ö ¹«·ÂÈ­½Ãų ½É°¢ÇÑ DoS °áÇÔ ¹ß°ß ½ÑÀ¥È£½ºÆà 10-20 41592
38 Oracle - sqlplus ·Î Á¢¼ÓÇϱâ, °èÁ¤»ý¼º, Å×À̺í»ý¼º ½ÑÀ¥È£½ºÆà 09-22 118223
37 centos¿¡ oracle 11gR2 ¼³Ä¡ ½ÑÀ¥È£½ºÆà 09-21 102609
36 ¹é¾÷ ½´ÆÛºí·° È®ÀÎÇϱ⠽ÑÀ¥È£½ºÆà 07-21 20593
35 vsftp ¿¡¼­ »óÀ§ Æú´õ À̵¿ ¸·±â ½ÑÀ¥È£½ºÆà 07-19 21547
34 Force10 OS Æß¿þ¾î ¾÷±×·¹ÀÌµå ½ÑÀ¥È£½ºÆà 06-28 42426
 1  2  3  4  5  6