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

3. ¼³Ä¡

GNUJSP¸¦ ¼³Ä¡Çϱ⿡ ¾Õ¼­ ¾ÆÆÄÄ¡¿Í JServ°¡ Á¦´ë·Î ¼³Ä¡µÇ¾î ÀÖ¾î¾ß ÇÑ´Ù. ¸¸ÀÏ ±×·¸Áö ¾Ê´Ù¸é ¾ÆÆÄÄ¡¿Í JServ¸¦ ¸ÕÀú ¼³Ä¡ÇÏ°í µ¿ÀÛÇÏ´Â °ÍÀ» È®ÀÎÇϱ⠹ٶõ´Ù.

°¡Àå ¸ÕÀú ÇÒ ÀÏÀº GNUJSP¸¦ ¼³Ä¡ÇÒ À§Ä¡¸¦ Á¤ÇÏ´Â °ÍÀÌ´Ù. /usr/local/gnujsp¿¡ ¼³Ä¡Çϱâ·Î Çß´Ù¸é /usr/local¿¡¼­ ¾ÐÃàÀ» Ç®°í, »ý¼ºµÈ µð·ºÅ丮(gnujsp-1.0.0)¸¦ gnujsp·Î ¹Ù²Ù¾î ÁÖ¸é µÈ´Ù. ÀÌ ±Û¿¡¼­´Â /usr/local/gnujsp-1.0.0¿¡ ¼³Ä¡µÈ °ÍÀ¸·Î °¡Á¤ÇÏ°Ú´Ù.

JSP ÆÄÀÏÀº ÀÚ¹Ù ÆÄÀÏ·Î º¯°æµÈ ÈÄ ÄÄÆÄÀÏ °úÁ¤À» °ÅÃÄ ÀÚ¹Ù ¹ÙÀÌÆ®ÄÚµå(.class ÆÄÀÏ)·Î ÀúÀåµÈ´Ù. ±×·¯¹Ç·Î ÀÌ ÆÄÀϵéÀ» ÀúÀåÇÒ µð·ºÅ丮¸¦ ¸¸µé¾î ÁÙ ÇÊ¿ä°¡ ÀÖ´Ù. ÀÌ µð·ºÅ丮´Â ¹Ýµå½Ã À¥½á¹ö »ç¿ëÀÚ(´ëºÎºÐÀÇ °æ¿ì nobody)°¡ ÀÐ°í ¾µ ¼ö ÀÖ¾î¾ß ÇÑ´Ù. /usr/local/apache/jsp¿¡ ¸¸µç´Ù¸é ´ÙÀ½°ú °°ÀÌ ÇÑ´Ù.

# mkdir /usr/local/apache/jsp
# chown nobody:nobody /usr/local/apache/jsp

´ë°³ÀÇ °æ¿ì À¥½á¹ö »ç¿ëÀÚ¿¡°Ô ±ÇÇÑÀ» ÁÖ±â À§Çؼ­´Â ¼öÆÛÀ¯Àú(root)ÀÇ ±ÇÇÑÀÌ ÇÊ¿äÇÏ´Ù.

ÀÌÁ¦ ¼³Á¤ ÆÄÀϵéÀ» ¼öÁ¤ÇÒ Â÷·ÊÀÌ´Ù. GNUJSPµµ ½áºí¸´À̹ǷΠ±âÁ¸ÀÇ ½áºí¸´ Á¸À» ¸¸µé¾î ³õ¾Ò´Ù¸é ±× °÷¿¡ Ãß°¡Çؼ­ »ç¿ëÇÏ¸é µÈ´Ù. ±× °æ¿ì ¾Æ·¡ÀÇ jsp.properties¿¡ Ãß°¡µÇ´Â ³»¿ëÀ» GNUJSP¸¦ ¼³Ä¡ÇÏ°íÀÚ ÇÏ´Â Á¸ÀÇ properties ÆÄÀÏ¿¡ Ãß°¡ÇØ ÁÖ¸é µÈ´Ù. ±âÁ¸ÀÇ Á¸À» »ç¿ëÇÏÁö ¾Ê°í »õ·Î¿î Á¸À» ¸¸µé°íÀÚ ÇÑ´Ù¸é ¼³Á¤ ÆÄÀÏÀ» »õ·Î ¸¸µé¾î¾ß ÇÑ´Ù. °¡Àå ½±°Ô ¼³Á¤ ÆÄÀÏÀ» ¸¸µå´Â ¹æ¹ýÀº ±âÁ¸¿¡ JServ¸¦ ¼³Ä¡ÇÏ°í ½ÃÇèÇϸ鼭 »ç¿ëÇÑ .properties ÆÄÀÏÀ» º¹»çÇÏ´Â °ÍÀÌ´Ù. À̸¦ jsp.properties¶õ À̸§À¸·Î º¹»çÇÏÀÚ. ÀÌ ÆÄÀÏ ¾ÈÀ» µé¿©´Ùº¸¸é repositories¸¦ Á¤ÀÇÇÏ°í ÀÖ´Â ºÎºÐÀÌ ÀÖÀ» °ÍÀÌ´Ù. ¿©±â¿¡ GNUJSP¿¡¼­ Á¦°øÇϴ Ŭ·¡½ºµéÀ» »ç¿ëÇÒ ¼ö ÀÖµµ·Ï ´ÙÀ½ µÎ ÁÙÀ» Ãß°¡ÇÑ´Ù.

repositories=/usr/local/gnujsp-1.0.0/lib/gnujsp10.jar
repositories=/usr/local/gnujsp-1.0.0/lib/servlet-2.0-plus.jar

µð·ºÅ丮´Â ½ÇÁ¦·Î GNUJSP°¡ ¼³Ä¡µÈ °÷¿¡ ¸Âµµ·Ï ¹Ù²Ù¾î ÁÖ¾î¾ß ÇÑ´Ù. ´ÙÀ½À¸·Î °°Àº ÆÄÀÏ¿¡¼­ Servlet Aliases¸¦ Á¤ÀÇÇÏ°í ÀÖ´Â °÷À» ã¾Æ ´ÙÀ½ µÎ ÁÙÀ» Ãß°¡ÇØ ÁØ´Ù.

servlet.gnujsp.code=org.gjt.jsp.JspServlet
servlet.gnujsp.initArgs=
    checkclass=true,
    pagebase=/usr/local/apache/htdocs,
    gnujspdir=/usr/local/gnujsp-1.0.0,
    scratchdir=/usr/local/apache/jsp,
    debug=true,
    compiler=builtin-javac -encoding KSC5601
        -classpath %classpath%:%scratchdir%:
        /usr/local/gnujsp-1.0.0/lib/servlet-2.0-plus.jar:
        /usr/local/gnujsp-1.0.0/lib/gnujsp10.jar -d %scratchdir%
         -deprecation %source%

servlet.gnujsp.initArgs= ÀÌÇÏ´Â ±²ÀåÈ÷ ±æÁö¸¸ ¸ðµÎ ÇÑ ÁÙ¿¡ µé¾î°¥ ³»¿ëÀÌ´Ù. À§ÀÇ ³»¿ë Áß pagebase·Î Á¤ÀÇÇÑ µð·ºÅ丮´Â ¾ÆÆÄÄ¡¿¡¼­ DocumentRoot·Î Á¤ÀÇÇØ ÁØ µð·ºÅ丮¸¦ ½á ÁÖ¸é µÈ´Ù. encodingÀ» KSC5601·Î ÇÑ °ÍÀº JSP ÆÄÀÏ¿¡¼­ ÇѱÛÀ» »ç¿ëÇÒ °æ¿ì¸¦ °í·ÁÇؼ­À̹ǷΠÇѱÛÀ» ¾²Áö ¾ÊÀ¸¸é ½á ÁÖÁö ¾Ê¾Æµµ ¹«¹æÇÏ°í, ´Ù¸¥ ¾ð¾î¸¦ »ç¿ëÇÑ´Ù¸é ÇØ´ç ¾ð¾î¿¡ ¸Â´Â ÀÎÄÚµù À̸§À¸·Î ¹Ù²Ù¾î ÁÖ¾î¾ß ÇÑ´Ù.

ÀÌ°ÍÀ¸·Î jsp.properties´Â ¿Ï·áµÇ¾ú´Ù. ±âÁ¸ÀÇ Á¸À» »ç¿ëÇÏÁö ¾Ê°í »õ·Î jsp Á¸À» Ãß°¡Çß´Ù¸é ½ÇÁ¦·Î jsp¸¦ JServ°¡ Á¸À¸·Î ÀνÄÇÒ ¼ö ÀÖµµ·Ï jserv.properties¿Í jserv.conf¸¦ °íÃÄÁÖ¾î¾ß ÇÑ´Ù. jserv.properties¿¡´Â ´ÙÀ½À» Ãß°¡ÇÑ´Ù.

zones=root,jsp
jsp.properties=/path/to/jsp.properties

zones ºÎºÐÀº ÀÌ¹Ì »ç¿ëÇÏ°í ÀÖ´Â Á¸ÀÇ À̸§ÀÌ ÀûÇô ÀÖÀ» °ÍÀÌ´Ù. °Å±â¿¡ jsp¸¦ Ãß°¡ÇÏ¸é µÈ´Ù. °æ·Î´Â ½ÇÁ¦·Î jsp.properties°¡ ÀÖ´Â °÷À» °¡¸®Å³ ¼ö ÀÖµµ·Ï °íÃÄ Áֱ⠹ٶõ´Ù. ±×¸®°í jserv.conf¿¡´Â ´ÙÀ½ µÎ ÁÙÀ» Ãß°¡ÇÑ´Ù. ±âÁ¸ÀÇ Á¸À» »ç¿ëÇÑ´Ù¸é ApJServAction¸¸À» Ãß°¡ÇÏ¸é µÈ´Ù.

ApJServMount /jsp /jsp
ApJServAction .jsp /jsp/gnujsp

¸ðµç ¼³Á¤ÀÌ ³¡³µÀ¸¹Ç·Î À¥½á¹ö¸¦ ´Ù½Ã ½ÇÇà½ÃÄÑ º¯°æµÈ ³»¿ëÀ» ¹Ý¿µ½ÃÅ°¸é µÈ´Ù.


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