· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
Linuxdoc Sgml/JSP-KLDP

You are not allowed to 'backlinks'


¸®´ª½º¿¡¼­ ÀÚ¹Ù ¼­ºí¸´°ú JSP »ç¿ëÇϱâ, Á¦2ÆÇ

¸®´ª½º¿¡¼­ ÀÚ¹Ù ¼­ºí¸´°ú JSP »ç¿ëÇϱâ, Á¦2ÆÇ

Ȳ ¼ºÁØ donquabi@netian.com

Id: jserv_jsp.html,v 2.0 2000/10/07

1. ÀÌ ¹®¼­¿¡ ´ëÇÏ¿©

°°Àº Á¦¸ñÀÇ ¹®¼­¸¦ ÀÌ¹Ì °ø°³ÇßÁö¸¸, ±× ÀÌÈÄ °ü·Ã ¼ÒÇÁÆ®¿þ¾î°¡ ¾÷±×·¹ÀÌµå µÇ¾ú°í, º¯°æµÈ »çÇ×µµ ÀÖ´Ù. À̸¦ ¶ÇÇÑ ¾Ë¸®°í, À̵éÀ» ¼³Ä¡ÇÑ °æÇèÀ» ÇÔ²² ³ª´©°íÀÚ ÇÑ´Ù.

ÀÌ ¹®¼­´Â ÇÊÀÚÀÇ °æÇèÀ» Åä´ë·Î, ¸®´ª½º »ó¿¡¼­ ¾ÆÆÄÄ¡ À¥ ¼­¹ö¿Í ÀÚ¹Ù ¼­ºí¸´°ú GNUJSP¸¦ »ç¿ëÇϱâ À§Çؼ­ ÇÊ¿äÇÑ ¼ÒÇÁÆ®¿þ¾î¸¦ ¼³Ä¡ÇÏ°í Á¶À²ÇÏ ´Â °úÁ¤À» ±â¼úÇÑ´Ù.

ÀÌ ¹®¼­¸¦ ´Ù¸¥ °÷¿¡ ¿Å±æ °æ¿ì¿¡ ¹Ýµå½Ã ÇÊÀÚ¿¡°Ô ¸ÞÀÏÀ» Áֽðí, ³»¿ëÀ» º¯°æÇÏÁö ¸¶½Ã°í Àü¹® ±×´ë·Î¸¦ ÀοëÇÏ¿©¾ß ÇÕ´Ï´Ù.

ÀÌ ¹®¼­´Â ÇÊÀÚÀÇ È¨ÆäÀÌÁö¿¡¼­µµ º¼ ¼ö ÀÖ´Ù: http://my.netian.com/~donquabi/linux/jserv/jserv_jsp-2.html

2. ¿î¿ë ȯ°æ

¿ì¼±, ÇÊÀÚÀÇ ¸®´ª½º ¿î¿ë ȯ°æÀº ´ÙÀ½°ú °°´Ù.

  • Pentium Pro 200MHz (RAM: 64MB)
  • ¿Í¿ì ¸®´ª½º 6.2 & RedHat Linux 7.0
  • Ä¿³Î 2.2.17
  • À¥ ¼­¹ö: apache-1.3.12

ÇÊÀÚ´Â ¾ËÂ¥ ¸®´ª½º 6.1À» »ç¿ëÇÏ´Ù°¡ ¿Í¿ì ¸®´ª½º 6.2¸¦ ¼³Ä¡ÇÏ¿´°í, ÃÖ±Ù¿¡´Â RedHat Linux 7.0À» ¼³Ä¡ÇÏ¿© »ç¿ë ÁßÀÌ´Ù. ÀÌ·± ¿¬À¯·Î ÀÌ ¹®¼­¿¡ ±â¼úÇÏ´Â ³»¿ëÀ» ÀÌµé µÎ °¡Áö ¸®´ª½º ¹èÆ÷º»¿¡¼­ ½ÃÇèÇÒ ¼ö ÀÖ¾ú´Ù. ¿Í¿ì ¸®´ª½º¿Í °°Àº ·¡µåÇÞ ¸®´ª½º 6.2¸¦ ±â¹ÝÀ¸·Î ÇÏ´Â ¹èÆ÷ÆÇ°ú RedHat Linux 7.0¿¡¼­µµ Å« ¹®Á¦¾øÀÌ Àû¿ë °¡´ÉÇÒ °ÍÀÌ´Ù. (Ȥ½Ã ÇÊÀÚ¿¡°Ô´Â ¾ø¾ú´ø ¹®Á¦°¡ ¿©·¯ºÐÇÑÅ×¼­ »ý±æ ¼öµµ ÀÖÀ» °ÍÀÌ´Ù. ¾î¶² °ÍµéÀÌ ¹®Á¦°¡ µÉÁö ÇÊÀÚ´Â ¿¹»óÄ¡ ¸øÇÏ°Ú´Ù. ¸¸ÀÏ ¿¹»óÄ¡ ¸øÇÑ ¹®Á¦°¡ ¹ß»ýÇÑ´Ù°í ÇÏ´õ¶óµµ ÇÊÀÚ¸¦ Å¿ÇÏÁö ¸»±â¸¦ ´çºÎÇÑ´Ù.)

3. Áغñ »çÇ×

¿ì¼±, ¿©±â¼­´Â ·¹µåÇÞ ¸®´ª½º 6.2 ÀÌ»ó°ú, ÇÔ²² ¹èÆ÷ÇÏ´Â ¾ÆÆÄÄ¡ À¥ ¼­¹ö 1.3.9 ÀÌ»óÀ» ¼³Ä¡ÇÏ¿´´Ù°í °¡Á¤ÇÏ°Ú´Ù.

¾ÆÆÄÄ¡ ¼­¹ö¿¡¼­ ÀÚ¹Ù ¼­ºí¸´À» »ç¿ëÇϱâ À§Çؼ­ ´ÙÀ½°ú °°Àº ¼ÒÇÁÆ®¿þ¾î ¸¦ ÁغñÇÏ¿©¾ß ÇÑ´Ù.

ÀÚ¹Ù ½ÇÇà ȯ°æÀº JDK 1.1.8 ¶Ç´Â Java 2 SDK, v1.3 Áß¿¡¼­ ¼±ÅÃÇÑ´Ù.

4. JDK ¼³Ä¡

ÀÌÀü ¹®¼­¿¡¼­ ÇÊÀÚ´Â IBM »ç¿¡¼­ Á¦°øÇÏ´Â ¸®´ª½º¿ë JDK 1.1.8À» ¼±ÅÃÇß¾ú´Ù. GNUJSP ¼³Ä¡ ¹®¼­¿¡¼­ JDK 1.1 À» »ç¿ëÇÏ¿© °³¹ßÇÏ¿´À½À» ¸í½ÃÇÏ°í Àֱ⠶§¹®¿¡ ÀÌ°ÍÀÌ °¡Àå ÀûÇÕÇÏ´Ù°í ÆÇ´ÜÇß´Ù. ¹°·Ð, ±× ´ç½Ã¿¡´Â ¸®´ª½º¿ë Java 2 PlatformÀÌ ¾ø¾ú´Ù. ¿ÃÇØ 7¿ù ÃÊ¿¡ IBMÀÌ Sun º¸´Ù ¸ÕÀú Java 2 SDK¸¦ ³»³õ¾Ò´Ù. À̹ø ÁÖ¿¡´Â Sunµµ Java 2 SDK, Standard Edition Version 1.3.0 for Linux (Intel x86)¸¦ ¹ßÇ¥Çß´Ù.

4.1 JDK 1.1.8

¼³Ä¡ µð·ºÅ丮¸¦ /usr/local·Î Á¤ÇÏ°í, ¾ÐÃà ÆÄÀÏÀ» Ǭ´Ù. ¿À·ù°¡ ¾ø´Ù¸é, ÇöÀç µð·ºÅ丮¿¡ jdk118 µð·ºÅ丮°¡ »ý±ä´Ù. °á°ú¸¦ È®ÀÎÇÑ´Ù.

¼³Ä¡ °úÁ¤À» ´ÙÀ½¿¡ º¸ÀδÙ.

$ su
Password:
# cd /usr/local
# tar zxvf ibm-jdk-l118-linux-x86.tgz
# ls
# 

±×¸®°í, ÇÊÀÚ´Â /usr/local/javaµµ /usr/local/jdk118°ú µ¿ÀÏÇÏ°Ô µÇµµ·Ï ¸µÅ©¸¦ ¸¸µé¾ú´Ù:ln -s /usr/local/jdk118 /usr/local/java. ¸¸ÀÏ ÀÚ¹Ù µð·ºÅ丮°¡ ´Ù¸¥ °÷¿¡ À§Ä¡ÇÑ´Ù¸é ÇÊÀÚó·³ ¸µÅ©¸¦ ¸¸µé¾î ÇØ°áÇÒ ¼ö ÀÖ´Ù.

4.2 IBM Java 2 SDK 1.3

¼³Ä¡ °úÁ¤À» ´ÙÀ½¿¡ º¸ÀδÙ.

$ su
Password:
# cd /usr/local
# tar zxvf IBMJava2-SDK-13.tgz
# ls
# 

ÀÌ °úÁ¤¿¡¼­ ¿À·ù°¡ ¾ø¾ú´Ù¸é, ¾ÐÃà ÆÄÀÏÀ» Ǭ ´ÙÀ½, ÇöÀç µð·ºÅ丮¿¡ IBMJava2-13 µð·ºÅ丮°¡ »ý±ä´Ù. ÇÊ¿äÇϸé, ¸µÅ©¸¦ ¸¸µç´Ù: ln -s /usr/local/IBMJava2-13 /usr/local/java2

5. JSDK ¼±ÅÃ

ApacheJServ ¼­ºí¸´ ¿£ÁøÀº ¼­ºí¸´ API 2.0 ±Ô°Ý¿¡ µû¶ó ±¸ÇöµÇ¾ú´Ù. µû¶ó¼­ ¾ÆÆÄÄ¡¿¡¼­ »ç¿ëÇÏ´Â ¼­ºí¸´Àº ¼­ºí¸´ 2.0 ±Ô°ÝÀ» ÁöÄÑ¾ß ÇÏ°í, ¶ÇÇÑ À̸¦ Áö¿øÇÏ´Â JSDK¸¦ »ç¿ëÇÏ¿© °³¹ßÇØ¾ß ÇÑ´Ù.

JSDK´Â ¼­ºí¸´À» ÄÄÆÄÀÏ ÇÏ°í, ½ÃÇèÇÏ´Â µ¥ ÇʼöÀûÀÎ °³¹ß µµ±¸ÀÌ´Ù. JSDK´Â ¸®´ª½º¸¦ À§ÇÑ ¹öÀüÀÌ º°µµ·Î Á¦°øµÇÁö ¾Ê´Â´Ù. ¼­ºí¸´ API ±Ô°ÝÀ» ¸¸µç ¼±(Sun) »ç¿¡¼­ Á¦°øÇÏ´Â ¼Ö¶ó¸®½º(Solaris)ÀÇ °ÍÀ» ¸®´ª½º¿¡¼­µµ »ç¿ë °¡´ÉÇÏ´Ù.

¶ÇÇÑ, Paul SiegmannÀÌ Á¦ÀÛÇÏ¿© LGPL·Î °ø°³ÇÑ ¹«·á JSDK¸¦ »ç¿ëÇÒ ¼öµµ ÀÖ´Ù. ¼­ºí¸´ API 2.0 ±Ô°Ý´ë·Î ±¸ÇöµÇ¾î ¼± »çÀÇ °Í°ú ¿ÏÀüÇÏ°Ô È£È¯¼ºÀ» °®´Â´Ù. ApacheJServ ÆÐÅ°Áö¿¡ À̸¦ Æ÷ÇÔ½ÃÄ×°í, ¿ì¼±ÀûÀ¸·Î ÀÌ°ÍÀ» »ç¿ë Åä·Ï ¼³Á¤ÇÏ¿´´Ù.

6. ApacheJServ RPM

ApacheJServ´Â 1.1 ¹öÀüºÎÅÍ ¼Ò½º ÆÄÀÏ°ú ÇÔ²² RPMµµ ¹èÆ÷µÈ´Ù. ÀÌÁ¦´Â ±»ÀÌ ¼Ò½º¸¦ ÄÄÆÄÀÏ ÇÏ¿© ½ÇÇà ÆÄÀÏÀ» ¸¸µé°í, ÇÔ²² ¹èÆ÷µÇ´Â »ùÇÃÀ» Âü°íÇÏ¿© ½ÇÇà¿¡ ÇÊ¿äÇÑ ±¸¼º ÆÄÀϵéÀ» Á÷Á¢ ±¸¼ºÇÏ¿© ¸¸µé¾î¾ß ÇÏ´Â °úÁ¤ÀÌ ÇÊ¿äÇÏÁö ¾Ê´Ù. ÀÌ °úÁ¤Àº INSTALL ÆÄÀÏ¿¡ »ó¼¼ÇÏ°Ô ¼³¸íµÇ¾î ÀÖÁö¸¸, Ãʺ¸ÀÚ¿¡°Ô´Â ¿©ÀüÈ÷ ¾î·Æ°í, ¶ÇÇÑ ¿©°£ ¹ø°Å·Î¿î °Ô ¾Æ´Ï´Ù.

6.1 ÆÐÅ°Áö ¼³Ä¡

¾ÆÆÄÄ¡¿Í JDK°¡ ¼³Ä¡µÇ¾î ÀÖ´Ù¸é, ´ÙÀ½°ú °°ÀÌ ApacheJServ ÆÐÅ°Áö¸¦ ¼³Ä¡ ÇÑ´Ù.

# rpm -i ApacheJServ-1.1.2-1.i386.rpm

¼³Ä¡ °úÁ¤¿¡ ¿À·ù°¡ ¾ø´Ù¸é, ÁöÁ¤µÈ µð·ºÅ丮¿¡ ÆÄÀÏÀÌ º¹»çµÇ°í, /etc/httpd/conf/httpd.conf ÆÄÀÏ¿¡ ApacheJServ¸¦ À§ÇÑ ±¸¼º ³»¿ëÀ» Ãß°¡ ÇÑ´Ù.

ÆÐÅ°Áö ¼³Ä¡·Î ÀÎÇØ »ý¼ºµÇ´Â µð·ºÅ丮¿Í Ãß°¡µÇ´Â ÆÄÀÏÀº ´ÙÀ½ÀÇ Ç¥¿Í °°´Ù.

+-----------------------------+-------------------+------------------+
|         µð·ºÅ丮            |      ÆÄ   ÀÏ      |     ¼³   ¸í      |
+-----------------------------+-------------------+------------------+
| /etc/httpd/conf/jserv/      | jserv.conf        |                  |
|                             | jserv.properties  | ±¸¼º ÆÄÀÏ        |
|                             | zone.properties   |                  |
+-----------------------------+-------------------+------------------+
| /etc/httpd/modules/         | ApacheJServ.jar   | ¼­ºí¸´ ¿£ÁøÀ»    |
|                             |                   |±¸ÇöÇÑ Å¬·¡½º ÆÄÀÏ|
+-----------------------------+-------------------+------------------+
| /home/httpd/classes/        | servlet-2.0.jar   | JSDK             |
+-----------------------------+-------------------+------------------+
| /home/httpd/servlets/       | Hello.class       | ¼­ºí¸´ ¿¹Á¦      |
|                             | IsItWorking.class |                  |
+-----------------------------+-------------------+------------------+
| /usr/doc/ApacheJServ-1.1.2/ |                   |¹®¼­ ÆÄÀ쵎       |
+-----------------------------+-------------------+------------------+
| /var/log/httpd/             | jserv.log         |·Î±× ÆÄÀÏ         |
+-----------------------------+-------------------+------------------+

7. GNUJSP RPM

GNUJSP´Â ¼± »çÀÇ ÀÚ¹Ù ¼­¹ö ÆäÀÌÁö(Java Server Pages)¸¦ ±¸ÇöÇÑ °ÍÀÌ´Ù. GNUJSP ¼­ºí¸´À» ¼³Ä¡Çϸé, .jsp È®ÀåÀÚ¸¦ °¡Áö´Â ÆÄÀÏÀ»ÀÚ¹Ù ¼Ò½º ÆÄÀÏ·Î ¹ø¿ªÇÏ¿© ÄÄÆÄÀÏ ÇÏ°í, ½ÇÇàÇÏ°Ô µÈ´Ù. GNUJSP 1.0Àº JSP 1.0 ±Ô°ÝÀ» Áö¿ø ÇÑ´Ù.

GNUJSP´Â ÀÚ¹Ù ¼Ò½º¿Í Ŭ·¡½º ÆÄÀÏ ÇüÅ·Î, ¹«·á·Î ¹èÆ÷µÈ´Ù. ¾ÆÆÄÄ¡¸¦ Æ÷ÇÔÇÏ¿© ±¤¹üÀ§ÇÑ Ç÷§Æû, À¥ ¼­¹ö, ¼­ºí¸´ ¿£ÁøÀ» Áö¿øÇÑ´Ù. ¾ÆÆÄÄ¡ ¼­¹ö¿¡ ¼³Ä¡ÇÏ´Â °æ¿ì´Â ÇÔ²² ¹èÆ÷µÇ´Â INSTALL.apache http://klomp.org/gnujsp/INSTALL.apache¹®¼­¸¦ Âü°íÇÑ´Ù.

GNUJSPµµ, ApacheJServ ÆÐÅ°Áö¿Í ¸¶Âù°¡Áö·Î, °£ÆíÇÑ ¼³Ä¡¿Í ±¸¼ºÀ» À§ÇÏ¿© RPM ÆÐÅ°Áö·Î ¸¸µé¾ú´Ù.

´ÙÀ½°ú °°ÀÌ GNUJSP ÆÐÅ°Áö¸¦ ¼³Ä¡ÇÑ´Ù.

# rpm -i gnujsp-1.0.1-1.i386.rpm

¼³Ä¡ °úÁ¤¿¡ ¿À·ù°¡ ¾ø´Ù¸é, /usr/lib/gnujsp µð·ºÅ丮¸¦ »ý¼ºÇÏ°í, Ŭ·¡½º ÆÄÀÏÀÌ º¹»çµÈ´Ù. ApacheJServ ±¸¼º ÆÄÀÏ¿¡ GNUJSP¸¦ À§ÇÑ ±¸¼º ³»¿ëÀ» Ãß°¡ÇÏ°í, GNUJSP ¼­ºí¸´ Á¸ ±¸¼º ÆÄÀÏÀ» Ãß°¡ÇÑ´Ù.

ÆÐÅ°Áö ¼³Ä¡·Î ÀÎÇØ »ý¼ºµÇ´Â µð·ºÅ丮¿Í Ãß°¡µÇ´Â ÆÄÀÏÀº ´ÙÀ½ÀÇ Ç¥¿Í °°´Ù.

+------------------------+---------------------+----------------------+------+
|        µð·ºÅ丮        |        ÆÄ ÀÏ        |         ¼³¸í         | ºñ°í |
+------------------------+---------------------+----------------------+------+
| /etc/httpd/conf/jserv/ | jserv.conf          | ApJServMount,        | ¼öÁ¤ |
|                        |                     | ApJServAction Ãß°¡   |      |
+------------------------+---------------------+----------------------+------+
| /etc/httpd/conf/jserv/ | jserv.properties    | classpath Ãß°¡       | ¼öÁ¤ |
|                        |                     |                      |      |
+------------------------+---------------------+----------------------+------+
| /etc/httpd/conf/jserv/ | gnujsp.properties   | GNUJSP¿ë ¼­ºí¸´ Á¸   | »ý¼º |
|                        |                     | ±¸¼º ÆÄÀÏ            |      |
+------------------------+---------------------+----------------------+------+
| /usr/lib/gnujsp/       | gnujsp10.jar        | JSP¸¦ ±¸ÇöÇÑ         | »ý¼º |
|                        | sax2.jar            | Ŭ·¡½º ÆÄÀÏ          |      |
|                        | openxml-1.2-w3c.jar |                      |      |
|                        | aelfred.jar         |                      |      |
+------------------------+---------------------+----------------------+------+
| /usr/doc/gnujsp-1.0.1/ |                     |¹®¼­ ÆÄÀÏ°ú JSP ¿¹Á¦µé| »ý¼º |
+------------------------+---------------------+----------------------+------+

8. ±¸¼º ÆÄÀÏ

ApacheJServ »ç¿ëÇÏ·Á¸é ´ÙÀ½°ú °°Àº ±¸¼º ÆÄÀϵéÀÌ ÇÊ¿äÇÏ´Ù.

8.1 jserv.conf ±¸¼º ÆÄÀÏ

jserv.conf ±¸¼º ÆÄÀÏÀº ¾ÆÆÄÄ¡ À¥ ¼­¹ö¿¡ ApacheJServ ¼­ºí¸´ ¿£ÁøÀ» °áÇÕÇϱâ À§ÇÑ ¼³Á¤ »çÇ×À» Ãß°¡ÇÑ´Ù.

GNUJSP ÆÐÅ°Áö°¡ Ãß°¡ÇÏ´Â ºÎºÐÀº ´ÙÀ½°ú °°´Ù.

+----------------------------------------------------------------------------------+
|  ApJServProperties /etc/httpd/conf/jserv/jserv.properties                        |
|      :                                                                           |
|  # Mount point for Servlet zones                                                 |
|  ApJServMount /wsj /wsjzone                                                      |
|  ApJServMount /servlets /root                                                    |
|  ApJServMount /servlet /root                                                     |
|      :                                                                           |
|  # Executes a servlet passing filename with proper extension in PATH_TRANSLATED  |
|  # property of servlet request.                                                  |
|  ApJServAction .jsp /wsj/gnujsp                                                  |
|      :                                                                           |
+----------------------------------------------------------------------------------+

8.2 jserv.properties ±¸¼º ÆÄÀÏ

jserv.properties ±¸¼º ÆÄÀÏÀº ApacheJServ ¼­ºí¸´ ¿£ÁøÀ» À§ÇÑ ½ÇÇà ȯ°æ À» ¼³Á¤ÇÑ´Ù.

´«¿©°Ü º¸¾Æ¾ß ÇÒ ºÎºÐÀº ´ÙÀ½°ú °°´Ù. JDK 1.1.8À» »ç¿ëÇÏ´Â °æ¿ìÀÌ´Ù.

+------------------------------------------------------------------+
|  # Execution parameters                                          |                       
|  wrapper.bin=/usr/local/java/bin/java                            |
|      :                                                           |
|  # CLASSPATH environment value passed to the JVM                 |
|  wrapper.classpath=/usr/local/java/lib/classes.zip               |
|  wrapper.classpath=/etc/httpd/modules/ApacheJServ.jar            |
|  wrapper.classpath=/home/httpd/classes/servlet-2.0.jar           |
|  wrapper.classpath=/usr/lib/gnujsp/servlet-2.0-plus.jar          |
|      :                                                           |
|  # Servlet Zones parameters                                      |
|  zones=root,wsjzone                                              |
|  root.properties=/etc/httpd/conf/jserv/zone.properties           |
|  wsjzone.properties=/etc/httpd/conf/jserv/wsjzone.properties     |
|      :                                                           |
+------------------------------------------------------------------+

¶ÇÇÑ, Java 2 SDK 1.3À» »ç¿ëÇÏ´Â °æ¿ì¿¡´Â ´ÙÀ½°ú °°´Ù.

+------------------------------------------------------------------+
|  # Execution parameters                                          |                       
|  wrapper.bin=/usr/local/java2/bin/java                           |
|      :                                                           |
|  # CLASSPATH environment value passed to the JVM                 |
|  wrapper.classpath=/usr/local/java2/lib/tools.zip                |
|  wrapper.classpath=/etc/httpd/modules/ApacheJServ.jar            |
|  wrapper.classpath=/home/httpd/classes/servlet-2.0.jar           |
|  wrapper.classpath=/usr/lib/gnujsp/servlet-2.0-plus.jar          |
|      :                                                           |
|  # Servlet Zones parameters                                      |
|  zones=root,wsjzone                                              |
|  root.properties=/etc/httpd/conf/jserv/zone.properties           |
|  wsjzone.properties=/etc/httpd/conf/jserv/wsjzone.properties     |
|      :                                                           |
+------------------------------------------------------------------+

8.3 wsjzone.properties ±¸¼º ÆÄÀÏ

wsjzone.properties ±¸¼º ÆÄÀÏÀº JSP¸¦ À§ÇÑ ½ÇÇà ȯ°æÀ» ¼³Á¤ÇÑ´Ù. ApacheJServ¿Í ÇÔ²² ¹èÆ÷µÇ´Â ¼­ºí¸´ Á¸ ±¸¼ºÆÄÀÏÀÎ zone.propertiesÀ» Åä´ë·Î ¸¸µé¾îÁø´Ù.

ÁÖ¿ä ºÎºÐÀº ´ÙÀ½°ú °°´Ù.

+--------------------------------------------------------------------------------+ | # List of Repositories | | ####################### | | | | # The list of servlet repositories controlled by this servlet zone | | # Syntax: repositories=[repository],[repository]... | | # Default: NONE | | # Note: The classes you want to be reloaded upon modification should be put | | # here. | | repositories=/usr/lib/gnujsp/gnujsp10.jar | | repositories=/usr/lib/gnujsp/sax2.jar | | repositories=/usr/lib/gnujsp/openxml-1.2-w3c.jar | | repositories=/usr/lib/gnujsp/aelfred.jar | | #repositories=/home/httpd/servlets | | : | | | | # Servlet Aliases | | ################## | | | | # This defines aliases from which servlets can be invoked. | | # Each alias give a new instance of the servlet. This means that if a servlet | | # is invoked both by class name and by alias name, it will result in _TWO_ | | # instances of the servlet being created. | | # Syntax: servlet.[alias].code=[classname] (String) | | # Default: NONE | | # servlet.snoop.code=SnoopServlet | | # servlet.hello.code=org.fool.Dummy | | servlet.gnujsp.code=org.gjt.jsp.JspServlet | | : | | | | # Aliased Servlet Init Parameters | | ################################## | | | | # These properties define init parameters for each servlet that is invoked | | # by its alias. | | # Syntax: servlet.[alias].initArgs=[name]=[value],[name]=[value],... | | # Default: NONE | | # servlet.snoop.initArgs=message=I'm a snoop servlet | | # servlet.hello.initArgs=message=I say hello world to everyone | | | | # give me debug output in the logs (time and space consuming) | | servlet.gnujsp.initArgs=debug=true | | # I want detailed path output in the logs (lot of stuff) | | # servlet.gnujsp.initArgs=pathdebug=true | | # where to put created java source and class files (www server needs write access!) | servlet.gnujsp.initArgs=scratchdir=/var/tmp/gnujsp | | # created java classes use packages instead of long file names | | servlet.gnujsp.initArgs=usepackages=true | | # remove comment if you want german messages :-) | | # servlet.gnujsp.initArgs=language=de,country=de | | # checkclass: is set to true: check for changes to jsp pages and recompile | | # checkdependancies: keep track of included files and check for changes | | servlet.gnujsp.initArgs=checkdependancies=true,checkclass=true | | # Do not remove java source files after compilation. (helpful for debugging) | | servlet.gnujsp.initArgs=keepJava=true | | # which sax parser to use for xml files (experimental!) | | # servlet.gnujsp.initArgs=xmlparser=com.microstar.xml.SAXDriver | | # builtin-java: use the java compiler classes from JDK | | servlet.gnujsp.initArgs=compiler=builtin-javac -classpath %classpath%:%scratch| |dir%:/usr/lib/gnujsp/gnujsp10.jar -d %scratchdir% -deprecation %source% | +--------------------------------------------------------------------------------+

9. ¼­ºí¸´ ½ÃÇè

ApacheJServ ÆÐÅ°Áö´Â ¾ÆÆÄÄ¡¸¦ À§ÇÑ ±¸¼º ³»¿ëÀ» httpd.conf ¿¡ Ãß°¡Çϱ⠶§¹®¿¡ ¼­¹ö°¡ ½ÇÇà ÁßÀÎ °æ¿ì¿¡ ¼­¹ö¸¦ Àç±âµ¿ÇÏ¿©¾ß ÇÑ´Ù.

9.1 ¼­¹ö ±âµ¿

¸ÕÀú, À¥ ¼­¹ö¸¦ ±âµ¿ÇØ¾ß ÇÑ´Ù. ¸¸ÀÏ, ÇöÀç À¥ ¼­¹ö°¡ ½ÇÇà ÁßÀ̶ó¸é Àç±âµ¿À» ÇØ¾ß ÇÑ´Ù.

# /etc/rc.d/init.d/httpd stop
# /etc/rc.d/init.d/httpd start

9.2 ¼­¹ö »óÅ º¸±â

¾ÆÆÄÄ¡ ¼­¹öÀÇ error_log ÆÄÀÏÀ» ¿­¾î ÆÄÀÏÀÇ ³¡ ºÎºÐÀ» µé¿©´Ù º¸ÀÚ: tail /var/log/httpd/error_log. ´ÙÀ½Àº ÇÊÀÚ°¡ RedHat Linux 7.0¿¡¼­ error_log ÆÄÀÏÀ» ¿­¾î º» °ÍÀ¸·Î, ÀÌ Áß¿¡¼­ ApacheJServ/1.1.2°¡ ÀÖ´Ù¸é, ¾ÆÆÄÄ¡ ¼­¹ö µ¥¸ó°ú ¼­ºí¸´ ¿£ÁøÀÌ Á¤»óÀûÀ¸·Î µ¿ÀÛ ÁßÀÓÀ» ¾Ë ¼ö ÀÖ´Ù.

+------------------------------------------------------------------+
|  ......                                                          |
|  ... [notice] Apache/1.3.12 (Unix) (Red Hat/Linux) mod_ssl/2.6.6 |
|OpenSSL/0.9.5a mod_perl/1.24 PHP/4.0.2 ApacheJServ/1.1.2 configure|
|d -- resuming normal operations                                   |
+------------------------------------------------------------------+

9.3 ¼­ºí¸´ ½ÇÇà

ApacheJServ ÆÐÅ°Áö¸¦ ¼³Ä¡Çϸé, /home/httpd/servlets µð·ºÅ丮¿¡ Hello, IsItWorking ¼­ºí¸´ ÆÄÀϵéÀÌ »ý¼ºµÈ´Ù. À¥ ºê¶ó¿ìÀú¸¦ ¶ç¿ö À̵é Áß¿¡¼­ IsItWorking ¼­ºí¸´À» ½ÇÇàÇØ º¸ÀÚ.

IsItWorking ¼­ºí¸´À» ½ÇÇàÇϱâ À§ÇÑ URLÀº ´ÙÀ½°ú °°´Ù.

http://localhost/servlet/IsItWorking

[[ IsItWorking ¼­ºí¸´ ½ÇÇà °á°ú: À¥ ºê¶ó¿ìÀú È­¸é]]

9.4 JSP ½ÇÇà

¼­ºí¸´ ½ÇÇàÀÌ ¼º°øÀûÀ̸é JSP ÆÄÀÏÀ» ½ÃÇèÇÑ´Ù. ¸¸ÀÏ ¿À·ù°¡ ÀÖ´Ù¸é, JSP ÆÄÀÏ¿¡ ´ëÇؼ­µµ ¿À·ù¸¦ ¸¸³¯ ¼ö ¹Û¿¡ ¾ø´Ù.

GNUJSP ÆÐÅ°Áö¸¦ ¼³Ä¡Çϸé, JSP ¿¹Á¦µµ ÇÔ²² ¼³Ä¡µÈ´Ù. À§Ä¡´Â /usr/share/doc/gnujsp-1.0.1/examples ÀÌ´Ù. ÀÌ Áß hello.jsp ÆÄÀÏ(¼³Ä¡ µ¿¾È¿¡ /home/httpd/html µð·ºÅ丮¿¡ º¹»çµÈ´Ù)À» /home/httpd/html µð·ºÅ丮¿¡ º¹»çÇÏ°í, À¥ ºê¶ó¿ìÀú¸¦ ÅëÇØ Á¢±ÙÇØ º»´Ù.

hello.jsp ÆÄÀÏ¿¡ Á¢±ÙÇϱâ À§ÇÑ URLÀº ´ÙÀ½°ú °°´Ù.

http://localhost/hello.jsp

[[ hello.jsp À¥ ºê¶ó¿ìÀú È­¸é]]

10. RedHat Linux 6.2¿Í 7.0ÀÇ Â÷ÀÌ

À¥ ¹®¼­´Â ·¹µåÇÞ ¸®´ª½º 6.2¿¡¼­´Â /home/httpd/html µð·º°í¸®¿¡, RedHat 7.0 ¿¡¼­´Â/var/www/html µð·ºÅ丮¿¡ À§Ä¡ÇÑ´Ù. ÀÌ ¹®¼­¿¡¼­ ¾ð±ÞÇÑ ApacheJServ RPM ¹× GNUJSP RPMÀº ·¹µåÇÞ ¸®´ª½º 6.2¿¡ ±âÁØÇÏ¿© Á¦À۵Ǿú´Ù. µû¶ó¼­ hello.jsp ÆÄÀÏÀº /home/httpd/html µð·ºÅ丮¿¡ º¹»çµÈ´Ù.

RedHat 7.0 À» »ç¿ëÇÏ´Â °æ¿ì¿¡´Â /home/httpd/html µð·ºÅ丮 ³»ÀÇ hello.jsp ÆÄÀÏÀ» /var/www/html µð·ºÅ丮·Î Á÷Á¢ º¹»çÇÏ¿©¾ß ÇÑ´Ù.

11. ¿¡Çʷα×

Áö±Ý±îÁöÀÇ °úÁ¤¿¡¼­ º°´Ù¸¥ ¹®Á¦°¡ ¾ø¾ú´Ù¸é, ¼­ºí¸´À» ½ÇÇàÇÏ¿© Á¤»óÀû ÀÎ °á°ú¸¦ º¸¾ÒÀ» °ÍÀÌ´Ù. ¶ÇÇÑ JSPµµ Á¤»óÀûÀ¸·Î ÀÛµ¿ÇÒ °ÍÀÌ´Ù. ÀÛÀº °¨µ¿ÀÌ ´À²¸ÁöÁö ¾Ê´Â°¡?

ApacheJServ 1.1°ú GNUJSP 1.0Àº Ãʱ⠼­ºí¸´ ±Ô°Ý°ú JSP ±Ô°ÝÀ» µû¸£´Â µ¥¼­ ½ÃÀ۵ưí, °è¼ÓµÈ °³¹ß °úÁ¤À» ÅëÇØ ÇöÀç´Â ¼­ºí¸´ ±Ô°Ý 2.0°ú JSP ±Ô°Ý 1.0À» ÃæÁ·ÇÑ´Ù. ÃÖ±Ù¿¡ ÀÌµé ±Ô°ÝÀº ¸ðµÎ ¾÷±×·¹ÀÌµå µÇ¾ú´Ù. ¼­ºí¸´ ±Ô°ÝÀº ÃÖÁ¾ 2.2 ¹öÀü±îÁö È®Á¤µÇ¾ú°í, 2.3 ¹öÀüÀÌ ÁغñµÇ¾î °ø°³ °ËÅä Áß¿¡ ÀÖ´Ù. ±×¸®°í, JSP ±Ô°ÝÀº 1.1 ¹öÀü±îÁö È®Á¤µÇ¾ú°í, 1.2 ¹öÀüÀÌ °ø°³ °ËÅä Áß¿¡ ÀÖ´Ù.

¶ÇÇÑ, GNUJSP¸¦ ´ëüÇÏ´Â, »õ·Î¿î °ø°³ JSP¸¦ ±¸ÇöÇÏ´Â ÇÁ·ÎÁ§Æ®°¡ ¾ÆÆÄÄ¡ (Apache Software Foundation)ÀÇ ÁÖµµ·Î ÁøÇà Áß¿¡ Àִµ¥ TomcatÀÌ ±×°ÍÀÌ´Ù. TomcatÀº ¼­ºí¸´ ¿£Áø 2.2¿Í JSP 1.1 ±â¼úÀ» °áÇÕÇÏ´Â ÂüÁ¶ ±¸Çö (reference implementation)ÀÌ´Ù. ÇöÀç ¾ÈÁ¤µÈ ¹öÀüÀº 3.1·Î¼­ ȨÆäÀÌÁö¿¡¼­ ¹ÙÀ̳ʸ® ÆÄÀÏ »Ó¸¸ ¾Æ´Ï¶ó ¼Ò½º ÆÄÀÏÀ» ³»·Á ¹ÞÀ» ¼ö ÀÖ´Ù.

12. Âü°í »çÇ×

À§ ³»¿ë Áß À߸øµÈ ºÎºÐÀ» ÁöÀûÇØ Áְųª Á¶¾ðÀ» ÁÖ½Ã¸é °¨»çÇÏ°Ú½À´Ï´Ù.

1999-2000 Ȳ ¼ºÁØ sj@kldp.org donquabi@netian.com


ID
Password
Join
Don't be overly suspicious where it's not warranted.


sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2003-08-10 11:52:30
Processing time 0.0019 sec