ÁÖÀÇ»çÇ×)
64ºñÆ® JSP±¤È£½ºÆÃ, ¸ÖƼȣ½ºÆÃ, ¿À¶óŬȣ½ºÆÃÀÇ JSP±â¹Ý À¥È£½ºÆÃÀº
apache+tomcat ¿¬µ¿ ±¸Á¶À̹ǷΠ¾Æ·¡ ¹æ¹ýÀÌ ¾Æ´Ñ [¿©±â]¸¦ Âü°íÇØÁֽñ⠹ٶø´Ï´Ù.
Tomcat JSP±¤È£½ºÆÃ?
±âÁ¸ apache+tomcat ¿¬µ¿±¸Á¶·Î Á¦°øµÇ´ø JSP±â¹Ý À¥È£½ºÆðú´Â ´Þ¸®
Tomcat È£½ºÆÃÀº apache ¾ø´Â tomcat ´Üµ¶È¯°æÀ¸·Î Á¦°øµÇ´Â ¼ºñ½ºÀ̹ǷÎ
ÀϹÝÀûÀÎ °³¹ßȯ°æ°ú µ¿ÀÏÇÏ°Ô ±¸¼ºÇÏ½Ç ¼ö ÀÖ´Ù´Â ÀåÁ¡ÀÌ ÀÖ½À´Ï´Ù.
|
1. Context Ãß°¡½Ã À§Ä¡´Â ±âº»ÀûÀ¸·Î server.xml¿¡ ¼³Á¤µÈ appBase(webapps)ÀÌÇÏ¿¡ Ãß°¡ÇϽþî
°í°´´Ô²²¼ ÀÌ¿ëÀ» ¿øÇϽô º°µµ applicationÀ» ±¸¼ºÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.
¾Æ·¡´Â 'test'¶ó´Â È£½ºÆðèÁ¤À¸·Î 'http://test.cafe24.com'À̶ó´Â Ä«Æä24 ±âº»µµ¸ÞÀÎÀ» ÀÌ¿ë½Ã¿¡
'http://test.cafe24.com/admin'À̶ó´Â ¼ºêµð·ºÅ丮·Î Context¸¦ ¼³Á¤ÇÏ´Â ¹æ¹ýÀÔ´Ï´Ù.
1) ssh Á¢¼Ó
[putty¸¦ ÀÌ¿ëÇÑ ssh Á¢¼Ó¹æ¹ý]
2) Context Ãß°¡¿¡ µû¸¥ xml ÆÄÀÏ ÀÛ¼º
# cd tomcat/conf/test/test.cafe24.com/
# vi admin.xml -->
xml ÆÄÀϸíÀº Context¸¦ ÀÌ¿ëÇÏ½Ç µð·ºÅ丮¸í°ú µ¿ÀÏÇÔ.
<?xml version='1.0' encoding='utf-8'?> <Context docBase='admin'> <WatchedResource>WEB-INF/web.xml</WatchedResource> </Context>
|
admin.xml ÀÛ¼º ÈÄ ÅèĹ Àç½ÃÀÛ¾øÀ̵µ Àû¿ëµÇ¹Ç·Î ¾Æ·¡ 3)¹ø ´Ü°è·Î ³Ñ¾î°©´Ï´Ù.
3) Context·Î ÀÌ¿ëÇÏ½Ç tomcat/webapps/admin µð·ºÅ丮¸¦ »ý¼ºÇϽðí,
ÇÊ¿äÇÑ ¼Ò½º ¹× WEB-INF/classes, WEB-INF/lib¸¦ admin ÀÌÇÏ¿¡ ¾÷·Îµå ¶Ç´Â ¹èÆ÷ÇϽŠÈÄ ÀÌ¿ëÇÏ½Ã¸é µË´Ï´Ù.
http://test.cafe24.com/admin À¸·Î Á¢¼ÓÈ®ÀÎ.
2. Subdomain Ãß°¡½Ã À§Ä¡´Â ±âº»ÀûÀ¸·Î tomcat/webapps_sub¿Í °°Àº »õ·Î¿î appBase¸¦ Ãß°¡Çϸç,
±âº» Context ·çÆ®´Â ROOTÀ̹ǷΠtomcat/webapps_sub/ROOT/index.jsp¿Í °°ÀÌ ±âº»»ç¿ë °¡´ÉÇÕ´Ï´Ù.
¾Æ·¡´Â 'http://sub.domain.com' ¼ºêµµ¸ÞÀÎÀ» webapps_sub¶ó´Â »õ·Î¿î appBase·Î ¿¬°áÇÏ´Â ¹æ¹ýÀÔ´Ï´Ù.
1) ssh Á¢¼Ó
2) server.xml ÆÄÀÏ¿¡ ¿¬°áÇÒ SubDomain °ü·Ã Host ±¸¹® Ãß°¡ÇÔ.
# cd tomcat/conf/
# vi server.xml -->
</Host> ÇÏ´Ü¿¡ ¾Æ·¡ ³»¿ë Ãß°¡ÇÔ.
<Host name="sub.domain.com" appBase="webapps_sub" unpackWARs="true" autoDeploy="true"> </Host>
|
3) ÅèĹ Àç½ÃÀÛ
# cd
# ./tomcat/bin/shutdown.sh
# ./tomcat/bin/startup.sh
4) ÅèĹ Àç½ÃÀÛ ÈÄ webapps_sub µð·ºÅ丮 ÀÚµ¿»ý¼ºµÊ.
5) tomcat/webapps_sub/ROOT/index.jsp ¼Ò½º»ý¼º ÈÄ
http://sub.domain.comÀ¸·Î ¿¬°áÈ®ÀÎ