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

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 À¥ ºê¶ó¿ìÀú È­¸é]]


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