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

<!doctype linuxdoc system>
<!-- Generated by txt2sgml 0.1 -->

<article>

<title>¸®´ª½º¿¡¼­ ÀÚ¹Ù ¼­ºí¸´°ú JSP »ç¿ëÇϱâ, Á¦2ÆÇ
<author>Ȳ ¼ºÁØ <htmlurl url="mailto:donquabi@netian.com" name="donquabi@netian.com"> 
<date>Id: jserv_jsp.html,v 2.0 2000/10/07 

<toc>

<sect> ÀÌ ¹®¼­¿¡ ´ëÇÏ¿©<p>

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

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

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

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


<sect> ¿î¿ë ȯ°æ<p>

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

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

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

<sect> Áغñ »çÇ×<p>

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

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

<itemize>
<item> <url url="http://www.ibm.com/java/jdk/118/linux/index.html" name ="JDK 1.1.8: ibm-jdk-l118-linux-x86.tgz">
<item> <url url="http://www6.software.ibm.com/dl/dklx130/dklx130-p" name ="IBM Java 2 SDK 1.3: IBMJava2-SDK-13.tgz">
<item> <url url="http://java.sun.com/products/servlet/download.html" name ="JSDK 2.0: jsdk20-solaris2-sparc.tar.Z">
<item> <url url="http://java.apache.org/jserv/dist/ApacheJServ-1.1.2-1.i386.rpm" name ="Apache JServ 1.1.2: ApacheJServ-1.1.2-1.i386.rpm">
<item> <url url="gnujsp-1.0.1-1.i386.rpm" name ="GNUJSP 1.0.1: gnujsp-1.0.1-1.i386.rpm"> 
</itemize>

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

<sect> JDK ¼³Ä¡<p>

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

<sect1>JDK 1.1.8<p>

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

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

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

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

<sect1>IBM Java 2 SDK 1.3<p>

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

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

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



<sect> JSDK ¼±ÅÃ<p>

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

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

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


<sect> ApacheJServ RPM<p>

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


<sect1>ÆÐŰÁö ¼³Ä¡<p>

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

<tscreen><verb>
# rpm -i ApacheJServ-1.1.2-1.i386.rpm
</verb></tscreen>

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

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

<tscreen><verb>
+-----------------------------+-------------------+------------------+
|         µð·ºÅ丮            |      ÆÄ   ÀÏ      |     ¼³   ¸í      |
+-----------------------------+-------------------+------------------+
| /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         |·Î±× ÆÄÀÏ         |
+-----------------------------+-------------------+------------------+
</verb></tscreen>



<sect> GNUJSP RPM<p>

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

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

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

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

<tscreen><verb>
# rpm -i gnujsp-1.0.1-1.i386.rpm
</verb></tscreen>

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

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


<tscreen><verb>
+------------------------+---------------------+----------------------+------+
|        µð·ºÅ丮        |        ÆÄ ÀÏ        |         ¼³¸í         | ºñ°í |
+------------------------+---------------------+----------------------+------+
| /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 ¿¹Á¦µé| »ý¼º |
+------------------------+---------------------+----------------------+------+
</verb></tscreen>


<sect> ±¸¼º ÆÄÀÏ<p>

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

<itemize>
<item> <url url="http://my.netian.com/~donquabi/linux/jserv/jserv_conf.txt" name="jserv.conf">
<item> <url url="http://my.netian.com/~donquabi/linux/jserv/jserv_properties.txt" name="jserv.properties">
<item> <url url="http://my.netian.com/~donquabi/linux/jserv/zone.properties.txt" name="¼­ºí¸´ Á¸[servlet zone] ±¸¼º ÆÄÀÏ">
<item> <url url="http://my.netian.com/~donquabi/linux/jserv/wsjzone_properties.txt" name="GNUJSP¿ë Á¸[servlet zone] ±¸¼º ÆÄÀÏ">
</itemize>

<sect1>jserv.conf ±¸¼º ÆÄÀÏ<p>

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

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

<tscreen><verb>
+----------------------------------------------------------------------------------+
|  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                                                  |
|      :                                                                           |
+----------------------------------------------------------------------------------+
</verb></tscreen>

<sect1>jserv.properties ±¸¼º ÆÄÀÏ<p>

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

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

<tscreen><verb>
+------------------------------------------------------------------+
|  # 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     |
|      :                                                           |
+------------------------------------------------------------------+
</verb></tscreen>

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

<tscreen><verb>
+------------------------------------------------------------------+
|  # 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     |
|      :                                                           |
+------------------------------------------------------------------+
</verb></tscreen>

<sect1>wsjzone.properties ±¸¼º ÆÄÀÏ<p>

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%         |
+--------------------------------------------------------------------------------+


<sect> ¼­ºí¸´ ½ÃÇè<p>

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

<sect1>¼­¹ö ±âµ¿<p>

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

<tscreen><verb>
# /etc/rc.d/init.d/httpd stop
# /etc/rc.d/init.d/httpd start
</verb></tscreen>

<sect1>¼­¹ö »óÅ º¸±â<p>

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

<tscreen><verb>
+------------------------------------------------------------------+
|  ......                                                          |
|  ... [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                                   |
+------------------------------------------------------------------+
</verb></tscreen>

<sect1>¼­ºí¸´ ½ÇÇà<p>

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

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

http://localhost/servlet/IsItWorking

[[<url url="http://my.netian.com/~donquabi/linux/jserv/working.jpg" name="IsItWorking ¼­ºí¸´ ½ÇÇà °á°ú: À¥ ºê¶ó¿ìÀú È­¸é">]]

<sect1>JSP ½ÇÇà<p>

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

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

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

http://localhost/hello.jsp

[[<url url="http://my.netian.com/~donquabi/linux/jserv/hellojsp-2.jpg" name="hello.jsp À¥ ºê¶ó¿ìÀú È­¸é">]]

<sect>RedHat Linux 6.2¿Í 7.0ÀÇ Â÷ÀÌ<p>

À¥ ¹®¼­´Â ·¹µåÇÞ ¸®´ª½º 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 µð·ºÅ丮·Î Á÷Á¢ º¹»çÇÏ¿©¾ß ÇÑ´Ù.

<sect>¿¡Çʷα×<p>

Áö±Ý±îÁöÀÇ °úÁ¤¿¡¼­ º°´Ù¸¥ ¹®Á¦°¡ ¾ø¾ú´Ù¸é, ¼­ºí¸´À» ½ÇÇàÇÏ¿© Á¤»óÀû
ÀÎ °á°ú¸¦ º¸¾ÒÀ» °ÍÀÌ´Ù. ¶ÇÇÑ 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)ÀÇ ÁÖµµ·Î ÁøÇà Áß¿¡ Àִµ¥ <url url="http://jakarta.apache.org/tomcat" name="Tomcat">ÀÌ
±×°ÍÀÌ´Ù. TomcatÀº ¼­ºí¸´ ¿£Áø 2.2¿Í JSP 1.1 ±â¼úÀ» °áÇÕÇÏ´Â ÂüÁ¶ ±¸Çö
(reference implementation)ÀÌ´Ù. ÇöÀç ¾ÈÁ¤µÈ ¹öÀüÀº 3.1·Î¼­ ȨÆäÀÌÁö¿¡¼­
¹ÙÀ̳ʸ® ÆÄÀÏ »Ó¸¸ ¾Æ´Ï¶ó ¼Ò½º ÆÄÀÏÀ» ³»·Á ¹ÞÀ» ¼ö ÀÖ´Ù.

<sect> Âü°í »çÇ×<p>

<itemize>
<item> <url url="http://my.netian.com/~donquabi/linux/jserv/jserv_jsp.html" name="¸®´ª½º¿¡¼­ ÀÚ¹Ù ¼­ºí¸´°ú JSP »ç¿ëÇϱâ">
<item> <url url="http://java.apache.org/" name="The Apache JServ Project">
<item> <url url="http://klomp.org/gnujsp/" name="GNUJSP">
<item> <url url="http://java.sun.com/products/servlet/" name="Java Server Pages">
<item> <url url="http://java.sun.com/products/servlet/" name="Java Servlet API">
<item> <url url="http://www.euronet.nl/~pauls/java/servlet/" name="Alternative Servlet implementation">
<item> <url url="http://www.servletcentral.com/1999-01/jserv.html" name="Servlet Central: Using Apache JServ 1.0b1">
<item> <url url="http://www.purpletech.com/servlet-faq/" name="Servlet FAQ">
<item> <url url="http://www.ibm.com/java/jdk/118/linux/index.html" name="Java 1.1.8 IBM Developer Kit for Linux">
<item> <url url="http://www.ibm.com/java/jdk/linux130/" name="IBM Developer Kit for Linux, Java 2 Technology Edition">
<item> <url url="http://java.sun.com/j2se/1.3/download-linux.html" name="Java 2 SDK, Standard Edition Version 1.3.0 for Linux (Intel x86)">
<item> <url url="http://jakarta.apache.org/tomcat/" name="Tomcat @ Jakarta">
<item> <url url="http://www.javaworld.com/javaworld/jw-09-2000/jw-0929-jspbooks.html/" name="Which JSP book serves up the best lesson?">
<item> <url url="http://www.javaworld.com/javaworld/jw-03-2000/jw-03-ssj-books.html" name="Java servlet books: A comparative review">
</itemize>


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

1999-2000 Ȳ ¼ºÁØ <htmlurl url="mailto:sj@kldp.org" name="sj@kldp.org"> <htmlurl url="mailto:donquabi@netian.com" name="donquabi@netian.com"> 

</article>




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.0070 sec