WWW Build, Refine and Management

¹è¼º¹Î
´ëÀü ±¤¿ª½Ã À¯¼º±¸ ±¸¼ºµ¿ 373-1
Çѱ¹°úÇбâ¼ú¿ø ÀüÀÚ°è»ê¼Ò Ãʰí¼ÓÁ¤º¸Åë½Å¸Á °øµ¿À̿뼾ÅÍ
E-mail : loveiris@ktmp.kaist.ac.kr
URL : http://ktmp.kaist.ac.kr/~loveiris/
Abstract:
Web ¼­¹öÀÇ ±¸ÃàÀº ´Ü¼øÈ÷ ÇÁ·Î±×·¥À» ÀνºÅçÇϰí Á¦°øµÇ´Â Á¤º¸¸¦ »ý¼º, °¡°øÇÏ´Â °Í¸¸ÀÌ ¾Æ´Ï¶ó, ±¸Ãà ÈÄ °ü¸®ÀÚ°¡ »ç¿ëÀÚ¿ÍÀÇ Áö¼ÓÀûÀÎ Feed Back À» ÅëÇÏ¿© »ç¿ëÀÚµéÀÌ »ç¿ëÇÏ±â Æí¸®ÇÏ°Ô ¸¸µé¾îÁÖ´Â ºÎºÐ±îÁö¸¦ Æ÷ÇÔÇϸç, À̸¦ À§ÇØ »ç¿ëÀÚµéÀÌ Web ¼­¹ö¿¡ Á¢¼ÓÇÑ ±â·Ï¿¡ ´ëÇÑ µ¥ÀÌŸ ºÐ¼®°úÁ¤ÀÌ ÇÊ¿äÇÏ°Ô µÈ´Ù.
ÀÌ °­ÀÇ¿¡¼­´Â Web ¼­¹öÀÇ ±¸Ãà Çʿ伺°ú ¼­¹ö¼±ÅÃ, ±×¸®°í ¼±ÅÃµÈ ¼­¹öÀÇ ±¸Ãà¹æ¹ý°ú ¿î¿µ¿¡ ´ëÇØ¼­ ÀÚ¼¼È÷ ¾Ë¾Æº¸°í, CGI ¿Í CGI ÇÁ·Î±×·¡¹Ö¿¡ ´ëÇÑ °³³äÀ» ÀÌÇØÇÏ°í °£´ÜÇÑ CGI ¸¦ ½ÇÇàÇÏ´Â ¹æ¹ýÀ» ¾Ë¾Æº¸µµ·Ï ÇϰڴÙ. ¶ÇÇÑ, Web ¼­¹ö¸¦ È¿À²ÀûÀ¸·Î °ü¸®Çϱâ À§ÇÑ ¹æ¹ýÀÇ Çϳª·Î Log file ÀÇ ºÐ¼® ¹æ¹ýÀ» »ìÆìº¸°í, À̸¦ È¿°úÀûÀ¸·Î ºÐ¼®ÇϱâÀ§ÇÑ Log Analyzer ÀÇ ½ÇÁ¦ »ç¿ë¹ý¿¡ ´ëÇØ¼­µµ ¼³¸íÇÑ´Ù.
Keywords:
WWW, httpd, APACHE server, CGI, Log file, Log Analyzer, getstat

1. Introduction

WWW °¡ óÀ½À¸·Î »ý±â°Ô µÈ °ÍÀº ¸¹Àº ¾çÀÇ ÇмúÀûÀÎ Á¤º¸¸¦ °øÀ¯Çϱâ À§Çؼ­ ¿´´Ù. ±×·¸Áö¸¸ ÇöÀçÀÇ WWW ´Â °³¹ßÃʱâÀÇ ¸ñÀûÀ̾ú´ø ÇмúÁ¤º¸ÀÇ °øÀ¯¶ó´Â Ãø¸é »Ó ¾Æ´Ï¶ó »ó¾÷, Á¤Ä¡, ¹®ÇÐµî »çȸÀÇ ´Ù¾çÇÑ ºÐ¾ß¿¡ °ÉÃļ­ Çõ¸íÀ» ÀÏÀ¸Å°°í ÀÖ´Ù°íÇØµµ °ú¾ðÀÌ ¾Æ´Ï´Ù.

ƯÈ÷ 1993³â NCSA (URL: http://www.ncsa.uiuc.edu) ¿¡¼­ GUI ±â¹ÝÀÇ Browser ÀÎ Mosaic ÀÌ Internet ¿¡ ÃâÇöÇÑ ÀÌÈÄ·Î WWW ÀÇ ¼ºÀåÀ²Àº ³×Æ®¿÷ÀÇ ¼ºÀåÀ²À» ´É°¡ÇÒ Á¤µµ¿´°í, Internet ÀÇ »ç¿ëÀÌ °ð WWW ÀÇ »ç¿ëÀ̶ó´Â µµ½ÄÀÌ Çü¼ºµÉ Á¤µµ·Î ¹ßÀüÇÏ¿´À¸¸ç, ¾ÕÀ¸·Îµµ °í¼Ó¼ºÀåÀº Áö¼ÓµÉ Àü¸ÁÀÌ´Ù.

ÀÌ·¯ÇÑ ÀÏ·ÃÀÇ ¼ºÀåÀÇ ºÐÀ§±â´Â 'Á¤º¸ÀÇ º¸°í' ¶ó°í ÀÏÄþîÁö´Â Internet ¿¡¼­ ´Ü¼øÈ÷ ÀÚ½ÅÀÌ ÇÊ¿äÇÑ Á¤º¸¸¦ ã±â¸¸ ÇÏ´Â °ÍÀÌ ¾Æ´Ï¶ó, ÀÚ½ÅÀÌ Á÷Á¢ Á¤º¸ÀÇ Á¦°øÀÚ ¿ªÇÒÀ» ÇÏ°í ½Í´Ù´Â ¿å±¸¸¦ âÃâÇÏ°Ô µÇ¾ú°í À̰ÍÀÌ Web ¼­¹ö¼öÀÇ Æø¹ßÀû Áõ°¡ÀÇ ÁÖ¿ä ¿äÀÎÀ¸·Î µîÀåÇÏ°Ô µÇ¾ú´Ù.

ÀÌ ¹®¼­¿¡¼­´Â ±×·¯ÇÑ ¿å±¸¸¦ ¸¸Á·½Ã۱â À§Çؼ­ Ãʺ¸Àڵ鵵 ½±°Ô Web ¼­¹ö¸¦ ¼³Ä¡ÇÒ ¼ö ÀÖµµ·Ï setup °úÁ¤À» ÀÚ¼¼È÷ ¼³¸íÇϰí, CGI (Common Gateway Interface) ÀÇ °³³ä°ú CGI ÇÁ·Î±×·¡¹ÖÀ» ÀÌÇØÇÏ°í ½ÇÁ¦·Î ¼³Ä¡ÇØ º½À¸·Î½á CGI ¸¦ »ç¿ëÇÒ ¼ö ÀÖµµ·Ï ÇÑ´Ù. ¶ÇÇÑ, Web ¼­¹ö¸¦ ±¸µ¿ÇÒ ¶§ »ý¼ºµÇ´Â Log file µéÀÌ ¾î¶»°Ô ±¸¼ºµÇ¾î ÀÖÀ¸¸ç ºÐ¼® Tool À» »ç¿ëÇØ¼­ ºÐ¼®ÇÏ´Â ¹æ¹ý°ú ºÐ¼®ÇÑ ÀÚ·áµéÀ» ¾î¶»°Ô ÀÌ¿ëÇÒ °ÍÀÎÁö¿¡ ´ëÇØ¼­ ³íÀÇÇØ º¸±â·Î ÇÑ´Ù.

2. How to setup HTTP server ?

2.1 Why do we launch HTTP server ?

WWW ¸¦ ÅëÇÏ¿© Á¤º¸¸¦ °øÀ¯Çϱâ À§Çؼ­´Â ¿ì¼± ¼­ºñ½º¸¦ Á¦°øÇÒ ¼ö ÀÖ´Â Web ¼­¹ö¸¦ ¼³Ä¡ÇØ¾ß ÇÑ´Ù. ÀÚ½ÅÀÇ Á¤º¸¸¦ Internet ¿¡ ¼Ò°³ÇÏ´Â ¹æ¹ý¿¡´Â ¿©·¯°¡Áö°¡ ÀÖÀ» ¼ö ÀÖÁö¸¸, WWW ¸¦ ÀÌ¿ëÇϰíÀÚ ÇÒ¶§ °¡Àå ¸ÕÀú ÇØ¾ßÇÒ ÀÏÀº Web ¼­¹ö¸¦ ¼³Ä¡ ÇÏ´Â °ÍÀÌ´Ù.

Web ¼­¹öÀÇ ¿ªÇÒÀº Browser ¸¦ ÅëÇÏ¿© Á¢¼öµÈ »ç¿ëÀÚ(End-User) ÀÇ ¿ä±¸(Request)¿¡ ´äÇÏ¿©(Response) Àß Á¤¸®µÈ (HTML ·Î ¾²¿©Áø) µ¥ÀÌŸ¸¦ »ç¿ëÀÚ¿¡°Ô Àü¼ÛÇÏ´Â °ÍÀÌ´Ù.


¸»ÇÏÀÚ¸é, Web ¼­¹ö´Â »ç¿ëÀÚÀÇ ¿ä±¸¿¡ ÀÀÇÏ¿© HTML ÇüÅ·ΠÁ¤¸®µÈ µ¥ÀÌŸ¸¦ Àü¼ÛÇÏ´Â ¿ªÇÒÀ» ÇÏ´Â °ÍÀÌ´Ù. À̿ܿ¡µµ Web ¼­¹ö´Â º¸¾È(Security) °ú »ç¿ë±â·Ï(Account)¸¦ À§ÇÑ Log file À» »ý¼ºÇϰí CGI µîÀ» ÅëÇØ¼­ ¿©·¯°¡Áö ȯ°æÀ» Á¦°øÇÑ´Ù.

2.2 Which is the BEST HTTP server ?

Web ¼­¹ö¸¦ ¼³Ä¡ÇÏ·Á°í ÇÒ¶§ ´ÙÀ½À¸·Î ¿ì¸®°¡ °áÁ¤ÇØ¾ß ÇÒ °ÍÀº ¾î¶² °ÍÀϱî? ¾î¶² Web ¼­¹ö¸¦ ¼³Ä¡ÇØ¾ß ÇÒ °ÍÀΰ¡¸¦ °áÁ¤ÇÏ´Â °Íµµ ±×¸® ½¬¿î ¹®Á¦´Â ¾Æ´Ò °ÍÀÌ´Ù. ¼­¹ö¸¦ ¼±ÅÃÇÒ¶§ °í·ÁµÇ¾î¾ß ÇÒ ¸î °¡Áö ¿ä¼ÒµéÀº ´ÙÀ½°ú °°´Ù. »ç¿ëÇÒ ¼ö ÀÖ´Â Web ¼­¹ö´Â ´Ù¾çÇÑ Á¦Ç°ÀÌ ÀÖÁö¸¸, ¿ì¼± ¼Õ½±°Ô ±¸ÇÒ ¼ö ÀÖ´Â Public Domain Software ¿¡¼­ ¼±ÅÃÇØº¸ÀÚ.

¹«»óÀ¸·Î Á¦°øµÇ´Â Web ¼­¹öµµ ÇöÀç ´Ù¾çÇÑ Á¦Ç°ÀÌ ³ª¿Í ÀÖÀ¸¹Ç·Î, ¼­¹ö¸¦ ¼±ÅÃÇÒ¶§´Â ¿ì¼± °¢ ¼­¹öÀÇ Àå/´ÜÁ¡À» ÆÄ¾ÇÇϰí, ¼­¹ö ¼³Ä¡¿Í À¯ÁöÀÇ ¿ëÀ̼º ¹× ¼º´ÉÀÇ Ãø¸éÀ» °í·ÁÇØ¾ß ÇÒ °ÍÀÌ´Ù. ¼º´ÉÀÇ Ãø¸é¿¡¼­´Â Àß Á¤¸®µÈ ÀÚ·á (URL: http://www.ncsa.uiuc.edu/InformationServers/Performance/V1.4/report.html) ¸¦ ±¸ÇÒ ¼ö ÀÖ´Ù.

°í¼º´ÉÀÌ¸ç ¼­¹ö Configuration ÀÌ ºñ±³Àû ¿ëÀÌÇÏ´Ù°í ¾Ë·ÁÁø NCSA ¼­¹ö¸¦ °íÃļ­ ¸¸µé¾ú´Ù´Â A PAtCHe Server (URL: http://www.apache.org) ¸¦ º¸¸é NCSA ¼­¹öº¸´Ù ´õ ºü¸£°í È¿À²ÀûÀ̶ó´Â °ÍÀ» ¾Ë ¼ö ÀÖ´Ù.

¿ì¸®´Â APACHE HTTP Server ¸¦ ¼±Åà ÇÏ¿´´Ù.

2.3 I'm a Novice. What shall I do now ?

2.3.1 Where can I get APACHE server ?

APACHE ¼­¹ö¸¦ ¼³Ä¡Çϱâ À§Çؼ­´Â, ¸ÕÀú APACHE ¼­¹öÀÇ Home page ³ª ȤÀº Anonymous ftp ¸¦ ÅëÇØ¼­ APACHE ¼­¹ö ÇÁ·Î±×·¥À» °¡Á®¿Í¾ß ÇÑ´Ù. ÇÁ·Î±×·¥À» °¡Á®¿Ã¶§´Â Source ¸¦ °¡Á®¿Í¼­ Á÷Á¢ Compile ÇÒ ¼öµµ ÀÖ°í, ÀÚ½ÅÀÇ ÄÄÇ»ÅÍ ±âÁ¾¹× OS ¿¡ ´ëÇØ¼­ ÀûÇÕÇÏ°Ô »ý»ýµÈ ¹ÙÀ̳ʸ® È­ÀÏÀ» °¡Á®¿Í¼­ ¼³Ä¡ÇÒ ¼öµµ ÀÖ´Ù. APACHE ¼­¹ö ÇÁ·Î±×·¥À» ¾òÀ» ¼ö ÀÖ´Â URL Àº ´ÙÀ½°ú °°´Ù.

http://www.apache.org
ftp://www.apache.org/apache/

¹°·Ð, Çѱ¹¿¡ ÀÖ´Ù¸é APACHE ¼­¹öÀÇ ¹Ì·¯¸µ »çÀÌÆ® (URL: http://cosmos.kaist.ac.kr/packages/www/apache/) ¸¦ ÀÌ¿ëÇÏ´Â °ÍÀÌ ´õ ºü¸¦ °ÍÀÌ´Ù.

ÇöÀçÀÇ APACHE ¼­¹öÀÇ ¹öÀüÀº 1.1.1 ÀÌ´Ù. 1.0.0 ¿¡¼­ÀÇ °³¼±»çÇ×Áß ÁÖ¿äÇÑ ¸î°¡Áö´Â ´ÙÀ½°ú °°°í, ´õ ÀÚ¼¼ÇÑ ³»¿ëÀº New Features (URL: http://cosmos.kaist.ac.kr/packages/www/apache/docs/1.1/)¸¦ Âü°íÇÏ¸é µÈ´Ù.

2.3.2 Server Configuration : Step by Step !!

2.3.2.1 PreRequisite

APACHE httpd ¼­¹ö¸¦ ±¸ÇÑÈÄ¿¡´Â ÀÚ½ÅÀÇ ½Ã½ºÅÛÀÇ ¾î´À À§Ä¡¿¡ ¼³Ä¡¸¦ ÇÒ °ÍÀÎÁö °áÁ¤ÇÏ¿©¾ß ÇÑ´Ù. °ü¸®ÀÚÀÇ ¸¶À½´ë·Î À§Ä¡¸¦ °áÁ¤ÇÒ ¼ö ÀÖÁö¸¸ º¸ÅëÀº /usr/local/etc/httpd ¿¡ ¼³Ä¡¸¦ ÇÑ´Ù. Áï, /usr/local/etc ¿¡¼­ ¾Æ·¡¿Í °°Àº ¹æ¹ýÀ¸·Î È­ÀÏÀÇ ¾ÐÃàÀ» Ç®¾îÁØ´Ù.
% gzip -cd apache_1.1.1-sparc-sun.sunos4.1.4.tar.gz | tar xvf -
apache_1.1.1 À̶õ µð·ºÅ丮°¡ »ý±â°Ô µÇ°í, ±× ¹Ø¿¡ ¸ðµç ÀÚ·áµé°ú ÇÁ·Î±×·¥µéÀÌ À§Ä¡ÇÏ°Ô µÈ´Ù. ±âÁ¸¿¡ ¼³Ä¡µÈ ¼­¹öÀÇ Configuration file À» ±×´ë·Î ÀÌ¿ëÇϱâ À§Çؼ­´Â apache_1.1.1 µð·ºÅ丮¸¦ httpd ·Î À̸§À» ¹Ù²Ù¾îÁÖ´ø°¡ Symbolic link ¸¦ ½ÃÄÑÁà¾ß ÇÑ´Ù. ´ÙÀ½Àº SunOS 4.1.4 ½Ã½ºÅÛÀÇ httpd µð·ºÅ丮 ±¸Á¶¸¦ º¸¿©ÁØ´Ù.
total 21
drwxr-xr-x  9 loveiris staff         512 Oct 15 11:27 ./
drwxr-xr-x  4 loveiris staff         512 Oct 14 22:50 ../
-rw-r--r--  1 loveiris staff        3738 Mar 13  1996 CHANGES
-rw-r--r--  1 loveiris staff        2604 Feb 22  1996 LICENSE
-rw-r--r--  1 loveiris staff        3059 Jul  3 15:24 README
drwxr-xr-x  2 loveiris staff         512 Jul  9 04:04 cgi-bin/
drwxr-xr-x  2 loveiris staff         512 Oct 15 11:12 conf/
drwxr-xr-x  2 loveiris staff         512 Jul  9 04:04 htdocs/
drwxr-xr-x  2 loveiris staff        2048 Jul  9 04:04 icons/
drwxr-xr-x  2 loveiris staff         512 Jul  9 04:04 logs/
drwxr-xr-x  2 loveiris staff        2048 Oct  5 10:18 src/
drwxr-xr-x  2 loveiris staff         512 Oct  5 10:19 support/

2.3.2.2 Configuring access.conf

ÀÌ È­ÀÏÀº httpd ¼­¹öÀÇ Á¢¼Ó¿¡ °üÇÑ ³»¿ë Áï, ¼­¹öÀÇ º¸¾È¿¡ °ü·ÃµÈ Á¤º¸¸¦ ´ã°í ÀÖ´Ù. ÀÓÀÇÀÇ »ç¿ëÀڷκÎÅÍÀÇ Á¢¼ÓÀ» Çã¿ëÇϰųª °ÅºÎÇÒ¼öµµ ÀÖ°í Æ¯Á¤»ç¿ëÀÚ¿¡°Ô¸¸ Á¢¼ÓÀ» Çã¿ëÇÒ ¼öµµ ÀÖÀ¸¸ç, ƯÁ¤ ³»¿ëÀº ¼û±æ¼öµµ ÀÖ´Ù.
# This should be changed to whatever you set DocumentRoot to.
<Directory /usr/local/etc/httpd/htdocs>

# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".

# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you (or at least, not yet).

Options Indexes FollowSymLinks
DocumentRoot ´Â »ç¿ëÀÚ°¡ Web ¼­¹ö¿¡ Á¢¼ÓÇßÀ»¶§ °¡Àå ¸ÕÀú º¸¿©ÁÖ´Â HTML ¹®¼­°¡ À§Ä¡ÇÒ °÷À» ÁöÁ¤ÇØ ÁÖ´Â °÷À̸ç, Web ¼­¹ö¿¡¼­ Á¦°øÇÏ´Â °¢Á¾ ¹®¼­µéÀÌ ÀúÀåµÇ°í °ü¸®µÇ´Â ÀÏÁ¾ÀÇ È¨ µð·ºÅ丮ÀÌ´Ù. À̰ÍÀ» »ç¿ëÇÒ¶§ 'Option' À» ÁöÁ¤ÇØ ÁÙ ¼ö Àִµ¥, ÀÌ´Â µð·ºÅ丮 È­Àϵ鿡 ´ëÇÑ ¼­¹öÀÇ È°¿ë ¹æ¹ýÀ» ÁöÁ¤ÇØ ÁÖ´Â ¿ªÇÒÀ» ÇÑ´Ù. ¿©·¯°¡Áö Option ÀÌ ÀÖÀ» ¼ö Àִµ¥ ¸î°¡Áö¸¸ »ìÆìº¸µµ·Ï ÇÑ´Ù.
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo", 
# "AuthConfig", and "Limit"

AllowOverride None
AllowOverride ¶ó´Â °ÍÀº ¾î¶² µð·ºÅ丮³ª È­ÀÏ¿¡ ´ëÇÑ Á¢¼ÓÀ» ƯÁ¤ Áý´ÜÀ̳ª »ç¿ëÀÚµé ¿¡°Ô¸¸ Çã¿ëÇÒ ¸ñÀûÀ¸·Î ±× µð·ºÅ丮¿¡ .htaccess ¸¦ ¼³Ä¡ÇÏ¿´À»¶§ ±× µð·ºÅ丮ÀÇ ³»¿ëÀ» º¸¿©ÁÙ °ÍÀÎÁö ¾Æ´ÑÁö¸¦ °áÁ¤ÇÏ°Ô ÇÑ´Ù.
# Controls who can get stuff from this server.

order allow,deny
allow from all

</Directory>
order ¶ó´Â °ÍÀº ¼­¹ö°¡ Á¢±Ù Á¦¾î¸¦ ¼öÇàÇÒ¶§ ½ÇÇàµÇ´Â ¼ø¼­¸¦ ³ªÅ¸³½´Ù. À§ÀÇ °æ¿ì´Â allow ±â´ÉÀ» ¼öÇàÇÑ ÈÄ¿¡ deny ±â´ÉÀ» ¼öÇàÇÏ´Â °ÍÀ» ³ªÅ¸³½´Ù. 'deny, allow' , 'allow, deny', 'mutual-failure' ÀÇ 3°¡Áö Áß¿¡¼­ Çϳª¸¦ ¼±ÅÃÇØ¾ß ÇÑ´Ù. ¸¶Áö¸·ÀÇ mutual-failureÀÇ °æ¿ì¿¡´Â Á¢±ÙÀ» Çã¿ëÇϰųª °ÅºÎÇÒ È£½ºÆ® ÁÖ¼Ò¸¦ allow ¿Í deny ¿¡ ¹Ýµå½Ã ³ªÅ¸³»¾ß ÇÑ´Ù. ÀÌ °æ¿ì allow ¿¡ ³ªÅ¸³ª´Â ÁÖ¼Ò´Â ¾î¶² °ÍÀ̵çÁö Á¢±ÙÀÌ Çã¿ëµÇ°í, deny ¿¡ ³ªÅ¸³ª´Â °ÍÀº ¾î¶² °ÍÀ̵çÁö °ÅºÎµÇ¸ç, ¾î´À ÂÊ¿¡µç ¸í½ÃµÇÁö ¾ÊÀº °ÍµéÀº Á¢±Ù °ÅºÎµÈ´Ù.

deny from Àº ¿­°ÅµÈ Áּҵ鿡 ´ëÇØ¼­´Â Á¢±ÙÀ» °ÅºÎÇϰڴٴ °ÍÀ» ³ªÅ¸³»¸ç, ÁÖ¼Ò¸¦ ³ªÅ¸³¾¶§´Â µµ¸ÞÀÎÀ̸§, È£½ºÆ®À̸§, È£½ºÆ® IP, IP ¾ÕºÎºÐ 3 ¹ÙÀÌÆ®¸¦ ¾µ ¼ö ÀÖ°í, ¸ðµç È£½ºÆ®¿¡ ´ëÇØ ÀÏÂ÷ÀûÀÎ Á¢±Ù °ÅºÎ¸¦ ³ªÅ¸³¾¶§´Â all ÀÌ ¾²ÀδÙ.

allow from Àº ³ª¿­µÇ¾î ÀÖ´Â Áּҵ鿡 ´ëÇØ Á¢±ÙÀ» Çã¿ëÇϰڴٴ °ÍÀ» ³ªÅ¸³»¸ç ÁÖ¼Ò¸¦ ³ªÅ¸³»´Â ¹æ¹ýÀº À§¿Í µ¿ÀÏÇÏ´Ù.

# /usr/local/etc/httpd/cgi-bin should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.

<Directory /usr/local/etc/httpd/cgi-bin>
AllowOverride None
Options None
</Directory>
ÀÌ ºÎºÐÀº WWW ¼­¹ö°¡ »ç¿ëÇÒ CGI µéÀÌ µé¾îÀÖ´Â µð·ºÅ丮¸¦ ÁöÁ¤ÇÏ´Â °ÍÀ̰í Option, AllowOverride ´Â À§ÀÇ °Í°ú °°Àº ¿ªÇÒÀ» ÇÏ°Ô µÈ´Ù.
# Allow server status reports, with the URL of http://servername/status
# Change the ".nowhere.com" to match your domain to enable.

#<Location /status>
#SetHandler server-status

#order deny,allow
#deny from all
#allow from .nowhere.com
#</Location>
APACHE httpd 1.1.1 ¿¡¼­ Ãß°¡µÈ ºÎºÐÀ¸·Î, ÀÌ ºÎºÐÀ» ¼³Á¤ÇØ µÎ¸é ƯÁ¤ È£½ºÆ® ȤÀº µµ¸ÞÀο¡¼­ Á¢¼ÓÇÏ´Â Client µé¿¡ ´ëÇÑ Á¤º¸¸¦ ¾òÀ» ¼ö ÀÖ°Ô µÈ´Ù. Server Statistics ¸¦ º¸´Â ¹æ¹ýÀº ¾Æ·¡¿Í °°´Ù.
 http://your.server.name/status/ 

2.3.2.3 Configuring httpd.conf

httpd.conf ´Â Server Configuration È­ÀϷμ­ ¼­¹öÀÇ ±¸µ¿¿¡ À־ °¡Àå Áß¿äÇÑ ¿ªÇÒÀ» ÇÏ´Â È­ÀÏÀÌ´Ù.
# ServerType is either inetd, or standalone.

ServerType standalone

# If you are running from inetd, go to "ServerAdmin".

inetd ¹æ½ÄÀ̶ó´Â °ÍÀº inetd ¶ó´Â process °¡ ÀÖ´Ù°¡ »ç¿ëÀÚÀÇ ¿ä±¸°¡ µé¾î¿Ã¶§¸¶´Ù »õ·Î¿î httpd process ¸¦ »ý¼º½ÃÄѼ­ »ç¿ëÀÚÀÇ ¿ä±¸¸¦ ó¸®Çϵµ·Ï ÇÏ´Â ¹æ½ÄÀ̰í, standalone ¹æ½ÄÀ̶ó´Â °ÍÀº Server pool ¹æ½Ä°ú °°Àº °ÍÀ¸·Î¼­ ¼­¹ö process ¸¦ ¹Ì¸® ¸¸µé¾î ³õ°í »ç¿ëÀÚÀÇ ¿ä±¸°¡ µé¾î¿À´Â´ë·Î ´ë±âÇϰí ÀÖ´Â ¼­¹ö process ¿¡°Ô ÀÏÀ» ÇÒ´çÇÏ´Â ¹æ½ÄÀÌ´Ù. ÀÌ ¹æ¹ýÀº »ç¿ëÀÚÀÇ ¿ä±¸°¡ ÀÖÀ»¶§¸¶´Ù »õ·Î¿î process ¸¦ »ý¼º(fork) ÇÏ´Â inetd ¹æ½Äº¸´Ù ¼­¹ö¸¦ »õ·Î »ý¼ºÇÏ´Â ½Ã°£À» ÁÙÀÓÀ¸·Î¼­ º¸´Ù ºü¸¥ ¹ÝÀÀ¼Óµµ¸¦ ¾òÀ» ¼ö ÀÖ´Ù´Â ÀåÁ¡ÀÌ ÀÖ´Ù. Unix ¿¡¼­ fork ´Â ½Ã°£ÀÌ ¸¹ÀÌ °É¸®´Â ÀÛ¾÷Áß Çϳª·Î Server pool ¹æ½ÄÀº »ç¿ëÀÚÀÇ ¼ö°¡ ¸¹¾ÆÁú¼ö·Ï »ó´çÇÑ ¼º´ÉÀÇ Çâ»óÀ» °¡Á®¿À°Ô

µÇ¸ç, ½ÇÁ¦ÀÇ ½ÇÇè°á°ú (URL: http://www.ncsa.uiuc.edu/InformationServers/Performance/V1.4/report.html) µµ ÀÌ »ç½ÇÀ» ÀÔÁõÇØ ÁØ´Ù.

# Port: The port the standalone listens to. For ports < 1023, you will
# need httpd to be run as root initially.

Port 80
0 ¿¡¼­ 1023 ±îÁöÀÇ port ´Â ½Ã½ºÅÛ¿¡ ¹Ì¸® ¿¹¾àÀÌ µÇ¾î ÀÖÀ¸¸ç ÁÖ¿ä ¼­ºñ½º¿¡ ´ëÇØ¼­´Â °íÀ¯ port ¹øÈ£°¡ ÇÒ´çµÇ¾î ÀÖ´Ù. httpd À» À§ÇÑ port ¹øÈ£´Â 80 ¹øÀ̰í À̰ÍÀ» Default ·Î »ç¿ëÇÑ´Ù. 1024 ¹øº¸´Ù Å« port ¹øÈ£ÀÇ »ç¿ëÀº ÀÏ¹Ý »ç¿ëÀÚµµ °¡´ÉÇϵµ·Ï µÇ¾î ÀÖÀ¸¸ç Á¢¼ÓÇÒ¶§´Â ¾Æ·¡ÀÇ ¿¹¿Í °°ÀÌ URL ¿¡ port ¹øÈ£±îÁö ¸í½Ã¸¦ ÇØÁÖ¾î¾ß ÇÑ´Ù.
 http://ktmp.kaist.ac.kr:8080/ 
# HostnameLookups: Log the names of clients or just their IP numbers
#   e.g.   www.apache.org (on) or 204.62.129.132 (off)
HostnameLookups on
Log file ¿¡ ±â·ÏµÇ´Â Client µéÀÌ ¾îµð¿¡¼­ Á¢¼ÓÇÏ¿´´ÂÁö¿¡ ´ëÇÑ Á¤º¸¸¦ IP address ·Î ³²±æ°ÍÀÎÁö ȤÀº È£½ºÆ® À̸§À¸·Î ³²±æ°ÍÀÎÁö¸¦ °áÁ¤ÇÏ´Â ºÎºÐÀÌ´Ù.
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.  

# User/Group: The name (or #number) of the user/group to run httpd as.
#  On SCO (ODT 3) use User nouser and Group nogroup
User nobody
Group #-1
standalone ¹æ½ÄÀ¸·Î ¼­¹ö¸¦ ±¸µ¿½ÃÄ×À»¶§ »ç¿ëµÇ´Â °ÍÀ¸·Î httpd ¼­¹ö°¡ »ç¿ëÀÚµéÀÇ ¿ä±¸¿¡ ´ëÇØ¼­ »ý¼º½ÃŰ´Â Child process ¿¡ ´ëÇÑ UID, GID ¸¦ ÁöÁ¤ÇØ ÁÖ´Â ºÎºÐÀÌ´Ù. root ¿Í °°ÀÌ ½Ã½ºÅÛÀ» °ü¸®ÇÏ´Â »ç¶÷ÀÇ UID ³ª GID ¸¦ »ç¿ëÇÏ´Â °æ¿ì´Â httpd process °¡ root ÀÇ ±ÇÇÑÀ» °¡Áö°Ô µÇ¹Ç·Î À߸øÇÏ¸é ½Ã½ºÅÛÀÌ Å©·¡Å·À» ´çÇÒ¼öµµ ÀÖ°Ô µÈ´Ù. ±×·¯¹Ç·Î ´ë°³ nobody ±×·ì¹× nobody »ç¿ëÀÚ¿¡ ´ëÇØ Á¤ÀǸ¦ ÇÏ°Ô µÈ´Ù. OS ÀÇ Á¾·ù¿¡ µû¶ó¼­ ¼³Á¤ÇÏ´Â ¹æ½ÄÀÌ ´Ù¸£¹Ç·Î ÁÖÀÇÇØ¾ß ÇÑ´Ù.
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.

ServerAdmin you@your.address

# ServerRoot: The directory the server's config, error, and log files
# are kept in

ServerRoot /usr/local/etc/httpd
¼­¹ö °ü¸®ÀÚÀÇ E-mail address ¸¦ Àû¾îÁÖ´Â °÷À̰í, ServerRoot ¶ó´Â °ÍÀº httpd ¼­¹ö ÇÁ·Î±×·¥ÀÌ ¼³Ä¡µÈ µð·ºÅ丮¸¦ Àû¾îÁÖ¸é µÈ´Ù.
# BindAddress: You can support virtual hosts with this option. This option
# is used to tell the server which IP address to listen to. It can either
# contain "*", an IP address, or a fully qualified Internet domain name.
# See also the VirtualHost directive.

#BindAddress *
BindAddress µÚ¿¡ ³ª¿­µÈ È£½ºÆ® ÁÖ¼Ò¿¡¼­ÀÇ Á¢¼Ó¸¸À» Çã¿ëÇÑ´Ù. Á¢±Ù ÅëÁ¦¸¦ ¸ñÀûÀ¸·Î ÀÌ¿ëµÉ ¼ö ÀÖÀ¸¸ç µÚ¿¡¼­ ¼³¸íµÉ Virtual host ¿Í´Â ÇÔ°Ô ¾²ÀÏ ¼ö ¾ø´Ù.
# ErrorLog: The location of the error log file. If this does not start
# with /, ServerRoot is prepended to it.


ErrorLog logs/error_log

# TransferLog: The location of the transfer log file. If this does not
# start with /, ServerRoot is prepended to it.

TransferLog logs/access_log

# PidFile: The file the server should log its pid to
PidFile logs/httpd.pid

# ScoreBoardFile: File used to store internal server process information
ScoreBoardFile logs/apache_status
Log file ÀÇ À̸§°ú À§Ä¡¸¦ ÁöÁ¤ÇØÁÖ´Â ºÎºÐÀÌ´Ù. ÀÚ¼¼ÇÑ °ÍÀº Log analyzer ºÎºÐ¿¡¼­ ´Ù·çµµ·Ï ÇÑ´Ù.
# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e. use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you 
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.

#ServerName new.host.name
Web ¼­¹öÀÇ À̸§À» Á¤ÇÏ´Â ºÎºÐÀ¸·Î º¸Åë È£½ºÆ®ÀÇ À̸§À» ½áÁÖÁö¸¸, ²À È£½ºÆ® À̸§°ú °°À» ÇÊ¿ä´Â ¾ø´Ù. ¿¹¸¦ µé¾î, www.your.domain.name À̶ó°í ÇÏ¸é ±× µµ¸ÞÀÎÀÇ ´ëÇ¥ Web ¼­¹ö°¡ µÇ´Â °ÍÀÌ º¸ÅëÀÌ´Ù.
# KeepAlive: The number of Keep-Alive persistent requests to accept
# per connection. Set to 0 to deactivate Keep-Alive support

KeepAlive 5

# KeepAliveTimeout: Number of seconds to wait for the next request

KeepAliveTimeout 15
¿øÇÏ´Â ÀڷḦ ã±â À§Çؼ­ ƯÁ¤ ¼­¹ö¿¡ Á¢¼ÓÀ» Çß´Ù°í ÇßÀ»¶§, º¸ÅëÀÇ °æ¿ì ´Ü ÇѰ¡ÁöÀÇ ÀڷḸÀ» ¾ò±â À§Çؼ­ Á¢¼ÓÇÑ °æ¿ì´Â µå¹° °ÍÀÌ´Ù. ´ëºÎºÐ ¿©·¯°³ÀÇ ¹®¼­µéÀ» µÚÀûÀ̸鼭 ã¾Æ¾ß ÇÒ °æ¿ì°¡ ¸¹´Ù. ±×·±µ¥, ½ÇÁ¦·Î ¾î¶² Browser °¡ ¼­¹ö¿¡¼­ µ¥ÀÌŸ¸¦ °¡Áö°í ¿Ã¶§´Â °¢°¢ÀÇ È­Àϸ¶´Ù ´Ù¸¥ TCP connection À» ÀÌ·ç¾î¼­ ¹®¼­¸¦ °¡Á®¿À°Ô µÈ´Ù. Áï, ¿ì¸®°¡ 10 °³ÀÇ È­ÀÏÀÌ ÇÊ¿äÇØ¼­ ¹Þ¾Æ¿Ã¶§´Â 10°³ÀÇ ¼­·Î ´Ù¸¥ TCP connection ÀÌ »ý±â°Ô µÇ´Â °ÍÀÌ´Ù. ¼Óµµ°¡ ºü¸¥ °æ¿ì¶ó¸é º° ¹®Á¦°¡ ¾ø°ÚÁö¸¸ ¸¸¾à ¼Óµµ°¡ ³Ê¹«³ª ´À¸° °æ¿ì¶ó¸é »ç¿ëÀÚÀÇ °üÁ¡¿¡¼­´Â Â¥Áõ³ª´Â ÀÏÀÌ µÉ °ÍÀÌ´Ù.

À̸¦ ÇØ°áÇϱâ À§Çؼ­ APACHE ¼­¹ö¿¡¼­´Â ¾î¶² ¼­¹ö¿¡ Á¢¼ÓÀ» ÇÑ °æ¿ì, ÀÏÁ¤ ½Ã°£µ¿¾ÈÀº »ç¿ëÀÚÀÇ ¿ä±¸°¡ ¾ø´õ¶óµµ ¿¬°áÀ» Áö¼Ó½ÃŲ´Ù. ±×·¯´Ù°¡, ¾î¶² ÀÏÁ¤ ½Ã°£µ¿¾È »ç¿ëÀÚÀÇ ¿ä±¸°¡ ¾øÀ¸¸é ºñ·Î¼Ò ¿¬°áÀ» Á¾·á½ÃŲ´Ù. ÀÌ ¹æ¹ýÀº ¾î¶² ¼­¹ö¿¡ ºó¹øÇÏ°Ô Á¢¼ÓÇÏ´Â °æ¿ì¿¡ ¼ÓµµÀÇ Çâ»óÀ» °¡Á®¿Ã ¼ö ÀÖ´Ù.

ÇÏÁö¸¸ À̸¦ ½Ã½ºÅÛÀÇ °üÁ¡¿¡¼­ º¸¸é ¾î¶»°Ô µÉ±î? ¼­¹öÀÇ °üÁ¡¿¡¼­ »ç¿ëÀÚÀÇ ¿ä±¸µµ ¾ø´Âµ¥ °è¼ÓÇØ¼­ Connection À» ¸Î°í Àִ´ٴ °ÍÀº Å« ºÎÇÏ·Î ÀÛ¿ëÇÏ°Ô µÈ´Ù. Áï, À̸¦ ¹æÁöÇϱâ À§Çؼ­ KeepAliveTimeout À» ¼³Á¤ÇÏ°Ô µÈ´Ù. À§ÀÇ ¿¹¿¡¼­ 15 ¶ó´Â °ÍÀº 15 Ãʸ¦ ÀǹÌÇÑ´Ù. Áï, 15Ãʵ¿¾È »ç¿ëÀÚÀÇ ¿ä±¸°¡ ¾ø¾ú´Ù¸é Connection À» Á¾·á½ÃŰ°Ú´Ù´Â °ÍÀ» ³ªÅ¸³½´Ù.

# Server-pool size regulation.  Rather than making you guess how many
# server processes you need, Apache dynamically adapts to the load it
# sees --- that is, it tries to maintain enough server processes to
# handle the current load, plus a few spare servers to handle transient
# load spikes (e.g., multiple simultaneous requests from a single
# Netscape browser).

# It does this by periodically checking how many servers are waiting
# for a request.  If there are fewer than MinSpareServers, it creates
# a new spare.  If there are more than MaxSpareServers, some of the
# spares die off.  These values are probably OK for most sites ---

MinSpareServers 5
MaxSpareServers 10

# Number of servers to start --- should be a reasonable ballpark figure.

StartServers 5

# Limit on total number of servers running, i.e., limit on the number
# of clients who can simultaneously connect --- if this limit is ever
# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
# It is intended mainly as a brake to keep a runaway server from taking
# Unix with it as it spirals down...

MaxClients 150

# MaxRequestsPerChild: the number of requests each child process is
#  allowed to process before the child dies.
#  The child will exit so as to avoid problems after prolonged use when
#  Apache (and maybe the libraries it uses) leak.  On most systems, this
#  isn't really needed, but a few (such as Solaris) do have notable leaks
#  in the libraries.

MaxRequestsPerChild 30
¾Õ¼­ ¾ð±ÞÇÑ Server pool ¹æ½ÄÀ» ÀÌ¿ëÇÒ¶§ ÀÌ¿ëµÇ´Â ºÎºÐÀ¸·Î¼­ StartServers ´Â ÃÖÃÊ¿¡ ¸î °³ÀÇ httpd process ¸¦ »ý¼º½ÃÄÑ ³õÀ» °ÍÀΰ¡ ÁöÁ¤ÇÏ´Â °ÍÀ̰í, Min/Max Spare Servers ¶ó´Â °ÍÀº ÀÏÁ¤ ½Ã°£¸¶´Ù ÇöÀç ´ë±âÇϰí ÀÖ´Â ¼­¹öÀÇ °¹¼ö¸¦ È®ÀÎÇÏ¿© ÃÖ¼Ò ¼­¹öÀÇ ¼öº¸´Ù ÀûÀ»¶§´Â process ¸¦ ´õ »ý¼º½ÃŰ°í ³²À» °æ¿ì´Â process ¸¦ ¾ø¾Ö´Â ¿ªÇÒÀ» ÇØ¼­ Ç×»ó ÀÏÁ¤ ¼ýÀÚÀÇ ¼­¹ö°¡ ´ë±âÇϰí ÀÖµµ·Ï ÇØÁÖ´Â ¿ªÇÒÀ» Çϸç, MaxClients ´Â ¼­ºñ½º¸¦ Á¦°øÇÏ´Â µ¿¾È ÃÖ´ë ¸î °³ÀÇ process ¸¦ »ý¼º °¡´ÉÇÏ°Ô ÇÒ °ÍÀΰ¡ ÁöÁ¤ÇÏ´Â °ÍÀÌ´Ù.

ÃÖ´ë °¹¼ö Á¦ÇÑÀÇ ¸ñÀûÀº httpd process ¿¡ ÀÇÇØ ½Ã½ºÅÛÀÌ Áö³ªÄ£ ºÎÇϸ¦ ¹ÞÁö ¾Ê°Ô Çϴµ¥ ÀÖ°í, À̸¦ ÃʰúÇÏ´Â »ç¿ëÀÚ ¿ä±¸°¡ µ¿½Ã¿¡ µé¾î¿À´Â °æ¿ì´Â ¼­ºñ½º¸¦ °ÅºÎÇÏ°Ô µÈ´Ù.

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the VirtualHost command

#Listen 3000
#Listen 12.34.56.78:80
ÁöÁ¤µÈ È£½ºÆ®ÀÇ port ¿¡¼­ Socket connection À» ¿­¾îµÎ°í ´ë±âÇϰڴٴ °ÍÀ» ³ªÅ¸³½´Ù.
# VirtualHost: Allows the daemon to respond to requests for more than one
# server address, if your server machine is configured to accept IP packets
# for multiple addresses. This can be accomplished with the ifconfig 
# alias flag, or through kernel patches like VIF.

# Any httpd.conf or srm.conf directive may go into a VirtualHost command.
# See alto the BindAddress entry.
 
#<VirtualHost host.foo.com>
#ServerAdmin webmaster@host.foo.com
#DocumentRoot /www/docs/host.foo.com
#ServerName host.foo.com
#ErrorLog logs/host.foo.com-error_log
#TransferLog logs/host.foo.com-access_log
#</VirtualHost>
Virtual Host ¶õ ÇϳªÀÇ ¼­¹ö¿¡ ¸î °³ÀÇ IP ÁÖ¼Ò¸¦ ÇÒ´çÇÏ¿©, ¾î´À IP ÁÖ¼Ò·Î µé¾î¿Â ¼­ºñ½º ¿ä±¸ÀÎÁö ¾Ë¾Æ³»¾î ÇØ´çÇÏ´Â º°µµÀÇ ¼­¹ö ȨÆäÀÌÁö·Î ¿¬°áÇØÁÖ´Â °ÍÀ» ¸»ÇÑ´Ù. À̰ÍÀ» ÀÌ¿ëÇÏ¿© ÇÑ ´ëÀÇ È£½ºÆ®¿¡¼­ ¼­·Î ´Ù¸¥ IP ÁÖ¼Ò¸¦ °¡Áö´Â ¿©·¯ °÷ÀÇ ¼­¹ö ȨÆäÀÌÁö¸¦ ±¸¼ºÇÒ ¼ö°¡ ÀÖ´Ù. <VirtualHost 127.0.0.1> ServerName localhost.kaist.ac.kr DocumentRoot /home1/www/localhost ResourceConfig conf/localhost_srm.conf TransferLog logs/localhost_access.log </VirtualHost>

È£½ºÆ® ³» »ç¿ëÀÚ¿Í ¿ÜºÎ¿¡¼­ Á¢¼ÓÇÏ´Â »ç¿ëÀÚ¿¡ ´ëÇØ ´Ù¸¥ ¼­ºñ½º¸¦ Á¦°øÇØÁÖÀÚ ÇÒ ¶§ À§¿Í °°Àº ¹æ½ÄÀ¸·Î ¼­ºñ½º ÇÒ ¼ö ÀÖ´Ù. ¹°·Ð, ÀÌ·± ±â´ÉÀ» ÀÌ¿ëÇϱâ À§Çؼ­´Â ÇϳªÀÇ È£½ºÆ®¿¡ ¿©·¯ °³ÀÇ IP ÁÖ¼Ò¸¦ ÇÒ´çÇÒ ¼ö ÀÖ´Â ½Ã½ºÅÛÀ̶ó¾ßÇÑ´Ù.

2.3.2.4 Configuring srm.conf

srm À̶õ Server Resource Map ÀÇ ¾àÀڷμ­ WWW ¼­¹öÀÇ ¿©·¯°¡Áö Resouce µé¿¡ ´ëÇÑ Á¢±Ù ¹æ¹ýÀ» ÁöÁ¤ÇØÁÖ´Â ¿ªÇÒÀ» ÇÑ´Ù.
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.

DocumentRoot /usr/local/etc/httpd/htdocs
¾Õ¿¡¼­ ¾ð±ÞµÈ access.conf È­ÀÏÀÇ DocumentRoot ¿Í °°Àº ±â´ÉÀ» ÇÑ´Ù.
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is recieved.

UserDir public_html
°¢ »ç¿ëÀÚµéÀÇ °³ÀÎ Home page µð·ºÅ丮¸¦ ÁöÁ¤ÇÑ´Ù. À̶§ÀÇ µð·ºÅ丮¸íÀº /etc/passwd È­ÀÏ¿¡ ³ªÅ¸³­ »ç¿ëÀÚÀÇ Home µð·ºÅ丮¿¡¼­ »ó´ëÀûÀ¸·Î ÁöÁ¤µÈ´Ù. ¸¸¾à °³ÀÎ »ç¿ëÀÚ°¡ ÀÚ½ÅÀÇ Home page ¸¦ ±¸ÃàÇÏ·Á ÇÑ´Ù¸é ÀÚ½ÅÀÇ Home µð·ºÅ丮 ¹Ø¿¡ public_html À̶õ µð·ºÅ丮¸¦ ¸¸µé°í ±×°ÍÀ» Home µð·ºÅ丮·Î ÇÏ¿© HTML ¹®¼­µéÀ» ÀÛ¼ºÇÏ¸é µÈ´Ù.
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.

DirectoryIndex index.html
ƯÁ¤ È­ÀÏÀ» ÁöÁ¤ÇÏÁö ¾Ê°í µð·ºÅ丮À̸§À¸·Î¸¸ URL À» ÁöÁ¤ÇÏ¿´À»¶§ ±× µð·ºÅ丮¿¡¼­ Default ·Î ã°ÔµÇ´Â È­ÀÏÀÇ À̸§À» ³ªÅ¸³½´Ù. ¿©·¯°³¸¦ ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù.
# FancyIndexing is whether you want fancy directory indexing or standard
FancyIndexing on
µð·ºÅ丮³ª È­ÀÏÀÇ ¸ñ·ÏÀ» º¸¿©ÁÙ¶§, È­ÀÏÀÇ Å©±â³ª Á¾·ù ¶Ç´Â È®ÀåÀÚ¿¡ µû¶ó¼­ ÁöÁ¤µÈ Icon À¸·Î º¸¿©ÁÙ °ÍÀÎÁö¸¦ ÁöÁ¤ÇØ ÁÖ´Â ºÎºÐÀÌ´Ù.
# AddIcon tells the server which icon to show for different files or filename
# extensions

AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
...
µð·ºÅ丮 index ÀÇ ÁÖ¾îÁø È­ÀÏ ÇüÅ¿¡ ´ëÇØ¼­ Ãâ·ÂÇÒ Icon À» ¹Ì¸® ÁöÁ¤ÇØ ÁÖ´Â ºÎºÐÀÌ´Ù. »ç¿ëÀÚÀÇ ÆíÀÇ¿¡ µû¶ó¼­ µ¡ºÙÀÏ ¼ö ÀÖ´Ù.
# DefaultIcon is which icon to show for files which do not have an icon
# explicitly set.

DefaultIcon /icons/unknown.gif
À§¿¡¼­ ÁöÁ¤ÇÑ Icon Á¤º¸°¡ ¾ø´Â È­ÀÏÀ» º¸¿©ÁÙ¶§ Default ·Î º¸¿©Áö´Â Icon À» ³ªÅ¸³½´Ù.
# AddDescription allows you to place a short description after a file in
# server-generated indexes.
# Format: AddDescription "description" filename
FancyIndexing ¿¡¼­ »ç¿ëµÇ´Â È­ÀÏ¿¡ ´ëÇÑ °£´ÜÇÑ ¼³¸íÀ» ÁöÁ¤ÇØÁÖ´Â ºÎºÐÀÌ´Ù. 'filename' ºÎºÐ¿¡´Â È®ÀåÀÚ³ª È­ÀÏÀ̸§ ȤÀº Wildcard Ç¥Çö¹æ¹ýÀÌ µé¾î°¥ ¼ö ÀÖ´Ù.
# ReadmeName is the name of the README file the server will look for by
# default. Format: ReadmeName name
#
# The server will first look for name.html, include it if found, and it will
# then look for name and include it as plaintext if found.
#
# HeaderName is the name of a file which should be prepended to
# directory indexes. 

ReadmeName README
µð·ºÅ丮 ¸ñ·ÏÀ» Ãâ·ÂÇÒ¶§, µð·ºÅ丮 index µÞºÎºÐ¿¡ °°ÀÌ Ãâ·ÂÇØÁÙ È­ÀϸíÀ» ÁöÁ¤ÇØ ÁÖ´Â ºÎºÐÀÌ´Ù. WWW ¸¦ ÀÌ¿ëÇÏ¿© Ftp service ¸¦ °âÇϰíÀÚ ÇÏ´Â °æ¿ì À¯¿ëÇÏ°Ô »ç¿ëµÇ´Â ºÎºÐÀÌ´Ù.
 HeaderName HEADER 
À§ÀÇ °Í°ú´Â ´Þ¸® ¾ÕºÎºÐ¿¡ µ¡ºÙÀÏ µð·ºÅ丮ÀÇ Custom header È­ÀÏÀ» ÁöÁ¤ÇÏ´Â ºÎºÐÀÌ´Ù.
# IndexIgnore is a set of filenames which directory indexing should ignore
# Format: IndexIgnore name1 name2...

IndexIgnore */.??* *~ *# */HEADER* */README* */RCS
µð·ºÅ丮 index ¸¦ Ãâ·ÂÇÒ¶§ ¹«½ÃÇÒ È­ÀϸíÀ» ÁöÁ¤ÇÑ´Ù.
# AccessFileName: The name of the file to look for in each directory
# for access control information.

AccessFileName .htaccess
Client ·Î ¹®¼­°¡ Àü´ÞµÉ¶§ ¼­¹ö´Â °¢ µð·ºÅ丮¸¶´Ù AccessFileName ¿¡¼­ ÁöÁ¤ÇÑ À̸§À» °¡Áø È­ÀÏÀÌ ÀÖ´ÂÁö¸¦ ã¾Æº» ÈÄ¿¡ Á¢±Ù Á¦¾î¸¦ ÇÒ °ÍÀÎÁö ¾Æ´ÑÁö¸¦ °áÁ¤ÇÏ°Ô µÈ´Ù.
# DefaultType is the default MIME type for documents which the server
# cannot find the type of from filename extensions.

DefaultType text/plain
¾î¶² È­ÀÏÀÇ ÇüŰ¡ ¼­¹ö°¡ °¡Áö°í ÀÖ´Â MIME.type °ú ÀÏÄ¡ÇÏÁö ¾ÊÀ»¶§, ±× È­ÀÏÀ» ¾î¶² ÇüÅ·Πº¸¿©ÁÙ °ÍÀÎÁö¸¦ °áÁ¤ÇÏ´Â º¯¼öÀÌ´Ù.
# AddEncoding allows you to have certain browsers (Mosaic/X 2.1+) uncompress
# information on the fly. Note: Not all browsers support this.

AddEncoding x-compress Z
AddEncoding x-gzip gz
È­ÀÏÀÇ È®ÀåÀÚ¿¡ µû¶ó ÁöÁ¤µÈ È­ÀÏÇüÅ·ΠÀνÄÀ» Çϵµ·Ï Á¤ÀÇÇØ ÁÖ´Â ºÎºÐÀÌ´Ù.
# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
# Format: Redirect fakename url
ƯÁ¤ÇÑ À̸§À¸·Î µé¾î¿À´Â ¼­ºñ½º ¿äûÀ» Á÷Á¢ ó¸®ÇÏÁö ¾Ê°í ´Ù¸¥ ¼­¹ö¿¡°Ô ³Ñ°ÜÁÖ°íÀÚ ÇÒ¶§ »ç¿ëµÈ´Ù. ¿©·¯ °÷¿¡ ºÐ»êµÇ¾î ÀÖ´Â ¼­¹öÀÇ µ¥ÀÌŸ¸¦ ÇϳªÀÇ URL ¿¡¼­ 󸮸¦ ÇØÁÙ ¼ö ÀÖ´Ù´Â ÀåÁ¡ÀÌ ÀÖ´Ù.
# Aliases: Add here as many aliases as you need (with no limit). The format is 
# Alias fakename realname

#Alias /icons/ /usr/local/etc/httpd/icons/
¼­¹ö °ü¸®ÀÚ°¡ ¾î¶² »çÁ¤¿¡ ÀÇÇØ¼­ ÇöÀç±îÁö »ç¿ëÇÏ´ø µð·ºÅ丮ÀÇ °æ·Î¸¦ ¹Ù²Û´Ù´ø°¡ ȤÀº µð·ºÅ丮ÀÇ À̸§À» ¹Ù²Ù¾úÀ»¶§ ±âÁ¸ÀÇ »ç¿ëÀÚµéÀÌ ¾Æ¹«·± ºÒÆí¾øÀÌ °è¼ÓÇØ¼­ »ç¿ëÇÒ ¼ö ÀÖµµ·Ï Á¶Ã³¸¦ ÃëÇØÁÙ¶§³ª ȤÀº º¹ÀâÇÑ µð·ºÅ丮±¸Á¶¸¦ °¡Áö°í ÀÖ´Â °æ¿ì º¹ÀâÇÔÀ» ÁÙÀ̱âÀ§ÇØ »ç¿ëÇÒ ¼ö ÀÖ´Â ¹æ¹ýÀ̸ç, ÁöÁ¤ÇÒ ¼ö ÀÖ´Â Alias ÀÇ ¼ö´Â Á¦ÇÑÀÌ ¾ø´Ù.
# ScriptAlias: This controls which directories contain server scripts.
# Format: ScriptAlias fakename realname

#ScriptAlias /cgi-bin/ /usr/local/etc/httpd/cgi-bin/
Web ¼­¹ö¿¡¼­ »ç¿ëÇÏ´Â CGI script ¸¦ ÀúÀåÇϰí ÀÖ´Â µð·ºÅ丮¸¦ ÁöÁ¤ÇÑ´Ù. ÀÌ µð·ºÅ丮 ³»¿¡ ÀÖ´Â È­ÀÏÀº ÀÐÇôÁö´Â°ÍÀÌ ¾Æ´Ï¶ó ½ÇÇàµÇ°Ô µÈ´Ù.
# AddHandler allows you to map certain file extensions to "handlers",
# actions unrelated to filetype. These can be either built into the server
# or added with the Action command (see below)
# Format: AddHandler action-name ext1

# To use CGI scripts:
#AddHandler cgi-script .cgi

# To use server-parsed HTML files
#AddType text/html .shtml
#AddHandler server-parsed .shtml

# Uncomment the following line to enable Apache's send-asis HTTP file
# feature
#AddHandler send-as-is asis

# If you wish to use server-parsed imagemap files, use
#AddHandler imap-file map

# To enable type maps, you might want to use
#AddHandler type-map var
È­ÀÏÀÇ Æ¯Á¤ÇÑ È®ÀåÀÚ¸¦ ÁöÁ¤Çؼ­ ±× È®ÀåÀÚ¸¦ °¡Áø È­ÀÏÀº ¾î¶² ÇÁ·Î±×·¥À¸·Î ÀÎ½Ä Ç϶ó´Â °ÍÀ» ÁöÁ¤ÇØ ÁÖ´Â ºÎºÐÀÌ´Ù. À­ ºÎºÐÀ» ¼³Á¤ÇØ ÁÖ¸é, ¼­¹ö´Â .cgi ¶ó´Â È®ÀåÀÚ¸¦ °¡Áö´Â È­ÀÏÀº CGI-script ·Î ÀνÄÀ» ÇÏ°Ô µÇ°í, .shtml ¶ó´Â È®ÀåÀÚ¸¦ °¡Áø È­ÀÏÀº Server-parsed HTML ·Î ÀνÄÇÏ°Ô µÈ´Ù.
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location

# For example to add a footer (footer.html in your document root) to
# files with extension .foot (e.g. foo.html.foot), you could use:
#AddHandler foot-action foot
#Action foot-action /cgi-bin/footer

# Or to do this for all HTML files, for example, use:
#Action text/html /cgi-bin/footer
Á¤ÀÇµÈ Media type ÀÌ ³ª¿À°Ô µÇ¸é ƯÁ¤ CGI script ¸¦ ½ÇÇàÇØÁÖ´Â ¿ªÇÒÀ» ÇÑ´Ù.
# MetaDir: specifies the name of the directory in which Apache can find
# meta information files. These files contain additional HTTP headers
# to include when sending the document

#MetaDir .web

# MetaSuffix: specifies the file name suffix for the file containing the
# meta information.

#MetaSuffix .meta
HTTP header ºÎºÐ¿¡ µé¾î°¡´Â meta Á¤º¸µéÀ» Æ÷ÇÔÇÏ´Â µð·ºÅ丮¿Í ±× È­ÀÏÀÇ È®ÀåÀÚ¸¦ ÁöÁ¤ÇØÁÖ´Â ºÎºÐÀÌ´Ù.
# Customizable error response (Apache style)
#  these come in three flavors
#
#    1) plain text
#ErrorDocument 500 "The server made a boo boo.
#  n.b.  the (") marks it as text, it does not get output
#
#    2) local redirects
#ErrorDocument 404 /missing.html
#  to redirect to local url /missing.html
#ErrorDocument 404 /cgi-bin/missing_handler.pl
#  n.b. can redirect to a script or a document using server-side-includes.
#
#    3) external redirects
#ErrorDocument 402 http://other.server.com/subscription_info.html
¾î¶² page ¿¡ Á¢¼ÓÀ» ÇßÀ»¶§ ±× page °¡ ¾ø¾îÁö°Å³ª ȤÀº ´Ù¸¥ °÷À¸·Î ¿Å°ÜÁ³°Å³ª ÇßÀ»¶§ ¹ß»ýÇÏ´Â Error ÀÇ Ã³¸®¸¦ ¾î¶»°Ô ÇÒ °ÍÀÎÁö¸¦ ÁöÁ¤ÇØ ÁÖ´Â ºÎºÐÀÌ´Ù. ±âº»ÀûÀ¸·Î Á¦°øµÇ´Â Error message ¸¸ Ãâ·ÂÇØ ÁÙ¼öµµ ÀÖ°í °ü¸®ÀÚ°¡ ¸¸µç Error message ¸¦ Ãâ·ÂÇØ ÁÙ¼öµµ ÀÖÀ¸¸ç ¿Å°ÜÁø page ¸¦ ¾Ë·ÁÁÖ´Â Message ¸¦ ³Ö¾îÁÙ ¼öµµ ÀÖ´Ù.

2.3.3 Launching the Server !!

2.3.3.1 Launching the HTTPd process

¾Õ¿¡¼­ »ìÆìº¸¾Ò´ø °Í°ú °°ÀÌ ¼­¹ö¸¦ ½ÇÇàÇÏ´Â ¹æ¹ý¿¡´Â µÎ °¡Áö ¹æ¹ýÀÌ ÀÖ´Ù. standalone ¹æ½Ä°ú inetd °¡ °ü¸®ÇÏ´Â ÇϳªÀÇ Demon À¸·Î ¶ç¿ì´Â ¹æ¹ýÀÌ ±×°ÍÀε¥ ½ÇÁ¦·Î Configuration ÀÌ ³¡³­ÈÄ¿¡ ±¸µ¿À» ½ÃŰ°Ô µÈ´Ù.

standalone À¸·Î ½ÇÇàÇÏ´Â °æ¿ì´Â ´ÙÀ½°ú °°´Ù.

 % httpd -r conf_file_path 
À̶§ 80 ¹ø port ¸¦ »ç¿ëÇÑ´Ù¸é root ÀÇ ±ÇÇÑÀ¸·Î ½ÇÇàÀ» ½ÃÄÑÁà¾ß ÇÑ´Ù. ±×¸®°í, È£½ºÆ®°¡ Rebooting µÉ¶§¸¶´Ù ÀÚµ¿ÀûÀ¸·Î ½ÇÇàÀÌ µÇ±â¸¦ ¿øÇÑ´Ù¸é, SunOS 4.x ¸¦ »ç¿ëÇÏ´Â ½Ã½ºÅÛÀÇ °æ¿ì´Â /etc/rc.local ÀÇ ÇÑÁÙÀ» Ãß°¡ÇØ¾ß Çϸç, Solaris 2.x ¸¦ »ç¿ëÇÏ´Â ½Ã½ºÅÛ À̶ó¸é /etc/rc3.d µð·ºÅ丮¿¡ S90locald ¶ó´Â À̸§À¸·Î È­ÀÏÀ» ¸¸µé¾î¼­ À§ÀÇ ¸í·É¾î¸¦ ³Ö¾îÁÖ¸é µÈ´Ù.

inetd ·Î ½ÇÇàÇÏ´Â °æ¿ì¿¡´Â /etc/services ¶ó´Â È­ÀÏ¿¡ httpd 80/tcp ¶ó´Â ÁÙÀ» Ãß°¡Çϰí /etc/inetd.conf È­ÀÏ¿¡ ´ÙÀ½À» ÷°¡Çϵµ·Ï ÇÑ´Ù.

 http stream tcp nowait nobody httpd_path httpd_command  
¸¸¾à NIS ¸¦ ½ÇÇàÁßÀ̶ó¸é, NIS source È­ÀÏÀ» °íÃľßÇÏ°í ´Ù °íÄ£ÈÄ¿¡ ypmake ¸¦ ÅëÇØ¼­ ÇØ´ç È£½ºÆ®¿¡ Àü´ÞµÇ¾î¾ß Á¦´ë·Î ÀÛµ¿ÇÏ°Ô µÈ´Ù. ±×¸®°í³ª¼­ inetd ¿¡°Ô kill -1 ·Î Hangup Signal À» ÁÖ¸é, ±×¶§ºÎÅÍ HTTP

¿¬°á¿ä±¸°¡ ¿Ã¶§¸¶´Ù httpd °¡ ÀÚµ¿ÀûÀ¸·Î »ý¼ºµÇ°Ô µÈ´Ù.

2.3.3.2 Terminating the HTTPd process

standalone À¸·Î ½ÇÇàµÇ¾îÀÖ´Â °æ¿ì´Â ¾Æ·¡¿Í °°Àº ¹æ¹ýÀ¸·Î PID ¸¦ ãÀº ´ÙÀ½ kill ·Î httpd ÀÇ µ¿ÀÛÀ» ÁߴܽÃų¼ö ÀÖ´Ù.
 % ps -awux | grep httpd 
Configuration file À» º¯°æÇÑ °æ¿ì º¯°æµÈ ³»¿ëÀÌ ½ÇÁ¦·Î Àû¿ëÀÌ µÇ·Á¸é Hangup Signal À» ÁØ´Ù. ±×·¸°Ô Çϸé httpd ¸¦ ÁߴܽÃŰÁö ¾Ê°í Configuration file À» ´Ù½Ã Àеµ·Ï ÇÒ ¼ö ÀÖ´Ù.

inetd ·Î ½ÇÇàµÈ °æ¿ì´Â HTTP ¿¬°á¿ä±¸°¡ ¿Ã¶§¸¶´Ù process °¡ »ý±â´Â °ÍÀ̹ǷΠ/etc/inetd.conf ÀÇ http ºÎºÐÀ» »èÁ¦ÇÏÁö ¾Ê´Â ÀÌ»ó ½ÇÇàÀ» ÁßÁö½Ãų ¼ö ÀÖ´Â ¹æ¹ýÀº ¾ø´Ù.

3. What is CGI ?

3.1 Introduction to CGI

3.1.1 What is CGI ?

CGI ´Â Common Gateway Interface ÀÇ ¾àÀڷμ­ Web Browser ¿¡ µ¿ÀûÀÎ µ¥ÀÌŸ¸¦ º¸³¾¶§ »ç¿ëµÈ´Ù. ¶ÇÇÑ, CGI ´Â Web ¼­¹ö¿¡¼­ ¿ÜºÎÀÇ ÇÁ·Î±×·¥À̳ª ¼ÒÇÁÆ®¿þ¾î¸¦ ½ÇÇàÇÒ ¼ö ÀÖ´Â °¡Àå °£´ÜÇÑ ¹æ¹ýÀ̶ó°í ÇÒ ¼ö ÀÖ´Ù. ´Ù½Ã ¸»Çϸé CGI ¶õ Web ¼­¹öÃø¿¡ ½ÇÇàÈ­ÀÏÀ» µÎ¾î Client ÀÇ ¿ä±¸¿¡ µû¶ó¼­ ±×¿¡ ¾Ë¸ÂÀº Ãâ·ÂÀ» »ý¼ºÇÏ¿© Client ¿¡°Ô º¸¿©ÁÖ´Â ¿ªÇÒÀ» ÇÏ´Â °ÍÀÌ´Ù.

Netscape °ú °°Àº Browser ¿¡¼­ ¾î¶² ¿ä±¸»çÇ×À» Web ¼­¹ö·Î º¸³»¸é ¼­¹ö´Â ±× ¿ä±¸»çÇ×À» CGI Ãø¿¡ ³Ñ°ÜÁÖ°í CGI ¿¡¼­ ó¸®µÈ °á°ú¸¦ ´Ù½Ã ¹Þ¾Æ¼­ Browser ·Î º¸³»ÁÖ°Ô µÈ´Ù.

3.1.2 What's good/bad?

CGI ´Â ¿©·¯°¡Áö Àå´ÜÁ¡À» °¡Áö°í Àִµ¥ ´ëºÎºÐÀº HTML ÀÇ Àå/´ÜÁ¡°ú ºñ½ÁÇÑ Á¡ÀÌ ¸¹´Ù. ±×°ÍÀº CGI ÀÇ ½ÇÇà°á°ú°¡ ¼­¹öÃø¿¡ ÀÖ´Â ÇÁ·Î·¥ÀÌ ¸¸µé¾î³»´Â HTML ¹®¼­¶ó°í ÇÒ ¼ö Àֱ⠶§¹®ÀÌ´Ù.
CGI ÀÇ ÀåÁ¡¿¡´Â ´ÙÀ½°ú °°Àº °ÍµéÀÌ ÀÖ´Ù.

3.1.3 What's difference between API and CGI ?

CGI ³ª API ´Â ±âº»ÀûÀ¸·Î Web ¼­¹öÀÇ ±â´ÉÀ» È®ÀåÇÏ´Â °ÍÀÌ ¸ñÀûÀÌ¸ç ±× ±¸Çö ¹æ¹ý¿¡¼­ Â÷À̰¡ ÀÖ´Ù.

CGI ´Â ¼­¹ö¿Í´Â ¿ÏÀüÈ÷ µ¶¸³ÀûÀÎ ÇϳªÀÇ process ¸¦ »ý¼ºÇÏ´Â °ÍÀ» ¸»ÇÑ´Ù. À̰ÍÀº ¼­¹öÀÇ Á¾·ù¿¡ °ü°è¾ø°í ¼­¹ö ¼ÒÇÁÆ®¿þ¾î¿Í ȣȯ¼ºÀÌ ÁÁÀ¸¸ç, ¾ÆÁÖ ´Ù¾çÇÑ ºÐ¾ßÀÇ Public Domain Program ÀÌ °³¹ßµÇ¾î Àֱ⠶§¹®¿¡ ±¸ÇöÇϱⰡ ½±°í ±×¸¸Å­ ³Î¸® »ç¿ëµÇ°í ÀÖ´Ù. ÀÌ·¯ÇÑ »ç½ÇµéÀÌ CGI ¸¦ Information Server ¿Í ȣȯµÇ´Â ¿ÜºÎ Application ÀÇ Ç¥ÁØÀ¸·Î ¸¸µç °ÍÀÌ´Ù.

ÀÌ·± °­·ÂÇÑ(!) ÀåÁ¡À» °¡Áö°í ÀÖ´Â ¹Ý¸é °¢°¢ÀÌ µ¶¸³ÀûÀÎ process À̱⠶§¹®¿¡ Resource ÀÇ ³¶ºñ°¡ ½ÉÇÏ´Ù´Â ´ÜÁ¡À» °¡Áø´Ù. ¼­¹ö°¡ °¢°¢ÀÇ Client ÀÇ ¿ä±¸¿¡ »õ·Î¿î CGI ÇÁ·Î±×·¥À» ½ÇÇà½ÃÄÑ¾ß ÇÑ´Ù´Â °ÍÀÌ´Ù. ÀÌ °æ¿ì »ç¿ëÀÚÀÇ ¿ä±¸°¡ ÀûÀ»¶§¿¡´Â ¹®Á¦°¡ µÇÁö ¾ÊÁö¸¸, CGI ÇÁ·Î±×·¥ÀÌ ºó¹øÈ÷ Á¢¼ÓµÈ´Ù¸é °¢ ¿ä±¸¿¡ »õ·Î¿î process ¸¦ »ý¼º(fork)ÇÏ´Â °ÍÀÌ ¼­¹öÀÇ ¼öÇà´É·Â¿¡ ½É°¢ÇÑ ¿µÇâÀ» ¹ÌÄ¥°ÍÀÌ´Ù.

API ´Â ¼­¹öÀÇ API ¸¦ ÀÌ¿ëÇØ¼­ ±â´ÉÀ» È®ÀåÇÏ´Â °ÍÀ» ÀǹÌÇÑ´Ù. Web ¼­¹ö¸¦ ±×´ë·Î È®ÀåÇÑ °á°úÀ̱⠶§¹®¿¡ ¼Óµµ°¡ ºü¸£°í È¿À²ÀûÀÌÁö¸¸ ¾î´À ƯÁ¤ ¼­¹öÀÇ API ¸¦ ÀÌ¿ëÇÒ °æ¿ì¿£ ´Ù¸¥ ¼­¹ö¿¡¼­´Â »ç¿ëÇÒ ¼ö ¾ø´Ù´Â Å« ´ÜÁ¡ÀÌ ÀÖ´Ù.

Netscape Server API (NSAPI) ´Â °í¼º´É°ú ¶Ù¾î³­ ±â´É - CGI ÇÁ·Î±×·¥À» ÀÛ¼ºÇÒ¶§ Shared Library ÇüÅ·Π¸¸µé°Ô µÇ°í, ½ÇÇàÇÒ¶§¿¡´Â Web ¼­¹ö°¡ Shared Library ÀÇ ÇÔ¼ö¸¦ È£ÃâÇϱ⠶§¹®¿¡ »õ·Î¿î process °¡ »ý±âÁö ¾Ê°Ô µÈ´Ù- À» Á¦°øÇÏ´Â CGI °°Àº ¾ÖÇø®ÄÉÀ̼ÇÀ» ¸¸µé±â À§ÇÑ ¼ö´ÜÀ¸·Î Á¦°øµÈ´Ù. ¿¹¸¦ µé¾î, NSAPI ´Â »ç¿ëÀÚ Á¢±ÙÁ¦¾î, ¿¡·¯Ã³¸®, DB ¿¬°á -CGI ·Î ±¸ÇöÇÑ´Ù¸é ¼­¹ö¿¡ ºÎ´ãÀ» ¸¹ÀÌ ÁÙ ÀÛ¾÷µé- °ú °°Àº ÀÏÀ» ó¸®Çϱâ À§Çؼ­ »ç¿ëÀÚ Function À» ÀÛ¼ºÇϴµ¥ »ç¿ëµÉ ¼ö ÀÖ´Ù. ÀÌ·¸°Ô NSAPI °¡ °³¹ßÀÚ¿¡°Ô º¸´Ù Çâ»óµÈ ±â´ÉÀÇ Web ¾ÖÇø®ÄÉÀ̼ÇÀ» ¸¸µé¼ö ÀÖµµ·Ï ÇØÁÖ´Â ¹Ý¸é¿¡ ÀÎÅÍÆäÀ̽º¿¡ »ç¿ëµÇ´Â ÇÁ·Î±×·¥Àº ¶Ç´Ù¸¥ ¼­¹ö¸¦ Áö¿øÇÏ±â ¾î·Æ±â ¶§¹®¿¡, Netscape Server ¿¡¸¸ ¿¬°áµÇ¾î¾ß ÇÑ´Ù´Â ´ÜÁ¡ÀÌ ÀÖ´Ù.

3.1.4 What's difference between SSI and CGI ?

SSI ´Â Server Side Include ÀÇ ¾àÀڷμ­ ¼­¹ö¿¡ ÀúÀåµÇ¾î ÀÖ´Â HTML È­ÀÏ ¼Ó¿¡ ¾î¶² ½ÇÇà ÇÁ·Î±×·¥ÀÇ °á°ú³ª ƯÁ¤ÀÇ È­ÀÏÀ» Æ÷ÇÔÇÒ ¼ö ÀÖµµ·Ï ÇÑ °ÍÀ» ÀǹÌÇÑ´Ù. ÀÌ´Â ¼­¹ö°¡ ´Ü¼øÈ÷ HTML È­ÀÏÀ» Àü¼ÛÇÏ´Â °ÍÀÌ ¾Æ´Ï¶ó, HTML È­ÀÏÀ» parsing ÇØ¼­ SSI ¿¡¼­ ÁöÁ¤ÇÑ °ÍÀ» ó¸®ÇÑ´Ù´Â °ÍÀ» ¶æÇÑ´Ù.

ÀÌ ±â´ÉÀº ¼­ºñ½º¸¦ ¿ä±¸ÇÏ´Â »ç¿ëÀÚ¿¡°Ô ¼­¹ö »ç¿ëÀڷμ­ ÇÁ·Î±×·¥ ½ÇÇàÀ» °¡´ÉÇÏ°Ô ÇÏ´Â ¿ªÇÒÀ» Çϰí ÀÖÀ¸¹Ç·Î ½Ã½ºÅÛ º¸¾È»óÀÇ ¹®Á¦¸¦ ÀÏÀ¸Å³¼öµµ ÀÖ´Ù. ±×·³¿¡µµ ºÒ±¸Çϰí SSI ´Â CGI ¸¦ »ç¿ëÇÏÁö ¾Ê°í¼­µµ Á¦ÇÑµÈ ¹üÀ§ÀÇ µ¿ÀûÀÎ HTML È­ÀÏÀ» ½±°Ô ¸¸µé ¼ö ÀÖ´Ù´Â Á¡°ú ¼­¹öÃø¿¡¼­ parsing À» ÇϹǷΠCGI ÀÇ °æ¿ìº¸´Ù ½Ã½ºÅÛ¿¡ ºÎ´ãÀ» Àû°Ô Áشٴ Á¡ÀÌ ÀåÁ¡ÀÌ´Ù.

3.2 Understanding CGI programming

3.2.1 Basic Concept of CGI programming

¿ì¸®°¡ CGI ÇÁ·Î±×·¥À» ÀÛ¼ºÇؼ­ »ç¿ëÀ» ÇÏ·Á¸é, ¿ì¸®¿¡°Ô ºñ±³Àû Àͼ÷ÇÑ C ÇÁ·Î±×·¥°ú ¾î¶² Â÷À̰¡ ÀÖ´ÂÁö¸¦ ¾Ë¾Æº¸´Â °ÍÀÌ Áß¿äÇÏ´Ù.

¿ì¼±, ±âÁ¸ÀÇ ´Ù¸¥ ÇÁ·Î±×·¥°ú ±âº»ÀûÀ¸·Î ´Ù¸¥ Á¡Àº ´ÙÀ½°ú °°´Ù.

  1. Client ¿¡¼­ ³Ñ¾î¿Â Argument ¸¦ Web ¼­¹ö°¡ CGI ÇÁ·Î±×·¥À¸·Î ³Ñ°ÜÁØ´Ù.
  2. CGI ÇÁ·Î±×·¥ÀÌ Ã³¸®ÇÑ °á°ú¸¦ Web ¼­¹ö¿¡°Ô º¸³»ÁØ´Ù.
±×·¯´Ï±î, Web ¼­¹ö¿¡¼­ µ¥ÀÌŸ¸¦ ¹Þ´Â ¹æ¹ý°ú, Web ¼­¹ö·Î °á°ú¸¦ º¸³»´Â ¹æ¹ý¸¸ÀÌ ±âÁ¸ÀÇ ÇÁ·Î±×·¥¿¡ Ãß°¡ µÇ´Â °ÍÀÌ´Ù. ±×·³, À̰Ϳ¡ ´ëÇØ¼­ ¾Ë¾Æº¸µµ·Ï ÇÏÀÚ.

  • Web ¼­¹ö¿¡¼­ µ¥ÀÌŸ¸¦ ¹Þ´Â ¹æ¹ý

    1. GET
    »ç¿ëÀÚÀÇ Form À̳ª URL ¿¡¼­ µ¥ÀÌŸ°¡ ¿À´Â ¹æ¹ýÀ¸·Î, Form ÀÇ °æ¿ì ¾Æ·¡¿Í °°Àº ÇüÅ·Πº¸³»Áö°Ô µÈ´Ù.

    <form method=GET action=xx.cgi> URL ·Î º¸³»´Â °æ¿ì´Â ¾Æ·¡¿Í °°Àº ÇüÅ·Πº¸³»Áö°Ô µÈ´Ù. http://..../xx.cgi?var1=value1&var2=value2 ½ÇÁ¦·Î Form ¿¡¼­ GET ¹æ¹ýÀ» »ç¿ëÇϸé, Browser ´Â »ç¿ëÀÚ°¡ Form ¾È¿¡ ³ÖÀº µ¥ÀÌŸ¸¦ À§ÀÇ URL ÇüÅ·Π¸¸µé¾î¼­ º¸³»ÁØ´Ù. ÀÌ °æ¿ì, Web ¼­¹ö´Â QUERY_STRING À̶ó´Â ȯ°æº¯¼ö¿¡ URL ÀÇ ? µÚ¿¡ ºÙ¾îÀÖ´Â µ¥ÀÌŸ¸¦ ¸ðµÎ ³Ö¾î¼­ º¸³½´Ù.

    ±×·¯´Ï±î CGI ÇÁ·Î±×·¡¸Ó´Â getenv("QUERY_STRING")À» ÇÑ´ÙÀ½, &, = ¸¦ º¸°í º¯¼öÀÇ À̸§°ú º¯¼ö¾È¿¡ µé¾îÀÖ´Â °ªÀ» ±¸ºÐÇÏ¸é µÈ´Ù.

    ÇÏÁö¸¸, ȯ°æº¯¼öÀÇ ¼³Á¤½Ã ±ÛÀÚ¼ö´Â 256 ÀÚ·Î Á¦ÇѵǹǷΠBBS µî¿¡¼­ ±ÛÀ» Æ÷½ºÆÃ ÇÏ´Â °æ¿ì´Â GET ÀÇ ¹æ¹ýÀ» ¾µ ¼ö ¾ø´Ù.

    2. POST

    <form method=post action=xx.cgi> À¸·Î Àü´ÞµÇ´Â °æ¿ìÀ̰í, µ¥ÀÌŸ°¡ ¼­¹ö¿¡ ¿À´Âµ¥¿¡´Â HTTP ÇÁ·ÎÅäÄÝ Çì´õ Á¤º¸°¡ ¿Â´ÙÀ½¿¡ Body Á¤º¸°¡ µû¶ó¿Â´Ù. °ð ´ëºÎºÐÀÇ HTTP ´Â GET À¸·Î µ¿ÀÛÇϱ⠶§¹®¿¡ ÀÌ Body Á¤º¸°¡ ¾ø´Âµ¥, POST ¹æ¹ýÀº ÀÌ Body Á¤º¸°¡ ÀÖ´Ù´Â Á¡ÀÌ ÇÁ·ÎÅäÄÝ ÀÚü¿¡¼­ Ʋ¸®´Ù. ±×¸®°í, ÀÌ Body ¿¡ var1=value1&var2=value2 ½ÄÀÇ Á¤º¸°¡ ¼­¹ö¿¡ Àü´ÞµÈ´Ù.

    ¼­¹ö´Â CGI ÇÁ·Î±×·¥¿¡ À̰ÍÀ» Àü´ÞÇÒ¶§ stdin À» ÀÌ¿ëÇÑ´Ù. ¼­¹ö´Â stdin ¿¡ var1=value1&var2=value2 ¶ó°í ¾²°í, ½ÇÁ¦·Î CGI ÇÁ·Î±×·¡¸Ó´Â À̰ÍÀ» ÇØ¼®ÇÏ´Â Routine À» Â¥¼­ &,= ¿¡ µû¶ó¼­ º¯¼ö À̸§°ú °ªÀ» ºÐ¸®ÇØ ³½´Ù. ÀÌ °æ¿ì µ¥ÀÌŸ°¡ ¼­¹ö·Î º¸³»¾îÁú¶§ EOF °¡ Ç¥½ÃµÇÁö ¾ÊÀ¸¹Ç·Î ÇÁ·Î±×·¡¸Ó´Â CONTENT_LENGTH ¶ó´Â ȯ°æº¯¼ö¸¦ ¹Þ¾Æ¼­ ¾ó¸¶¸¸Å­ÀÇ µ¥ÀÌŸ°¡ Àü¼ÛµÇ´ÂÁö ¾Ë¾ÆµÎ¾î¾ß ÇÑ´Ù.

    ÀÌ·¸°Ô Çϸé ÀÌÁ¦ º¸ÅëÀÇ C ÇÁ·Î±×·¡¹Ö¿¡¼­ ÇÏ´ø argc, argv ¸¦ ¹ÞÀ» ¼ö ÀÖÀ¸¹Ç·Î, ±× ´ÙÀ½ ÇÁ·Î±×·¥Àº ´Ù¸¥ ÀÏ¹Ý ÇÁ·Î±×·¥°ú ¶È°°ÀÌ ±¸¼ºÇÏ¸é µÈ´Ù.

  • Web ¼­¹ö·Î °á°ú¸¦ º¸³»´Â ¹æ¹ý

    ±×·¸´Ù¸é Ãâ·ÂÇÏ´Â ºÎºÐÀº ¾î¶»°Ô µÉ±î. CGI ÇÁ·Î±×·¥Àº °á°ú¸¦ stdout ¿¡ ¹Ù·Î print ÇÏ°í ¼­¹ö´Â ¿©±â¿¡ Ãâ·ÂµÈ °á°ú¸¦ Àо Web Browser ¿¡ º¸³½´Ù. ÀϹÝÀûÀ¸·Î °á°ú¸¦ HTML ·Î º¸³»¹Ç·Î, ¸ðµç output À» ÇÒ¶§ ¸Ç óÀ½¿¡

    printf("Content-type:text/html\n\n"); ¶ó°í ÇÑ´ÙÀ½, ¿øÇÏ´Â HTML ¹®ÀåÀ» ½áÁØ´Ù.
    ¿©±â¿¡¼­ Content-type Àº °á°ú¸¦ HTML Çü½ÄÀ¸·Î º¸³½´Ù´Â °ÍÀÌ°í ¸¶Áö¸·¿¡ \n\nÀº ºó ¶óÀÎÀ» Çϳª µÎ¾î¼­ °á°úÀÇ Header Á¤º¸¿Í Body Á¤º¸¸¦ ºÐ¸®½ÃŰ´Â °ÍÀÌ´Ù. ³ª¸ÓÁö °á°ú´Â HTML ¹®Àå¿¡¼­ ¾²´ø º¸ÅëÀÇ HTML ¹®¹ýÀ¸·Î Ãâ·ÂÀ» ÇÏ¸é µÈ´Ù. °£´ÜÇÑ ¿¹´Â ´ÙÀ½°ú °°´Ù. printf("<body bgcolor=white>\n");

    3.2.1 Easy and Simple CGI Example

    C ¾ð¾î·Î ÀÛ¼ºµÈ ¸î°¡Áö ÇÁ·Î±×·¥À¸·Î ÀÌÁ¦±îÁö ¼³¸íµÈ °ÍÀ» È®ÀÎÇØ º¸±â·Î ÇÑ´Ù.

    CGI ´Â ½ÇÇàÈ­ÀÏÀ» ¸¸µé¼ö ÀÖ´Â °ÍÀÌ¸é ¾î´À ÇÁ·Î±×·¡¹Ö ¾ð¾î·Î ÀÛ¼ºÇصµ ¹«°üÇÏ´Ù. ÇÏÁö¸¸, C ·Î ÀÛ¼ºµÈ °ÍÀº Interpret µÇ´Â °ÍÀÌ ¾Æ´Ï¶ó Compile µÈ°ÍÀ̹ǷΠSource code ÀÇ º¸¾È¹®Á¦¿¡ ½Å°æÀ» ´ú ½áµµ µÇ°í Perl °°Àº Interpreter Script º¸´Ù ÈξÀ ½ÇÇà¼Óµµ°¡ »¡¶óÁö´Â ÀåÁ¡À» °¡Áö°Ô µÈ´Ù.

    ¾Æ·¡ÀÇ °ÍÀº Client °¡ »ç¿ëÇÏ´Â Browser ÀÇ Á¾·ù¸¦ Ãâ·ÂÇØÁÖ´Â C ÇÁ·Î±×·¥ÀÌ´Ù. ÀÌ CGI °¡ ½ÇÇàµÉ¶§´Â HTTP_USER_AGENT ¶ó´Â ȯ°æº¯¼ö¸¦ Àоî¿Í¼­ HTML Çü½ÄÀ¸·Î Ãâ·ÂÇØ ÁØ´Ù. ¶ÇÇÑ À̰ÍÀº SSI ¸¦ ÀÌ¿ëÇØ¼­ <!--#echo var="HTTP_USER_AGENT"--> ¶ó°í ½ÇÇàÇØµµ µÈ´Ù. ±× ¿¹°¡ ÀÌ ¹®¼­ÀÇ ¸Ç ³¡¿¡ ³ª¿ÍÀÖ´Ù.

    #include <stdio.h> main() { printf("Content-type:text/html\n\n"); printf("<HTML><BODY BGCOLOR=\"#ffffff\">\n"); printf("Your web Browser is %s<P>\n", getenv("HTTP_USER_AGENT")); printf("</HTML>"); return(0); } °£´ÜÇÑ C ¾ð¾î·Î ÀÛ¼ºµÈ CGI script ÀÌ´Ù. CGI °¡ ÀÖ´Â directory ¿¡ visit-data ¶ó´Â È­ÀÏÀ» ¸¸µé°í ±× ¾È¿¡ ÃʱⰪÀ» ¼³Á¤ÇØ µÐ´Ù. ¿øÇÏ´Â À§Ä¡¿¡¼­ <!--#exec cgi="/cgi-bin/visit-counter.cgi"--> ¶ó°í ³Ö¾îÁֱ⸸ ÇÏ¸é µÈ´Ù. ±×·¸Áö¸¸ ÁÖÀÇÇØ¾ß ÇÒ Á¡ÀÌ ÀÖ´Ù. SSI ÀÇ °æ¿ì ´ë¼Ò¹®ÀÚ¸¦ ±¸ºÐÇÏ°Ô µÇ¹Ç·Î exec cgi ´Â ¹Ýµå½Ã ¼Ò¹®ÀÚ·Î ½áÁÖ¾î¾ß ÇÑ´Ù´Â °ÍÀÌ´Ù. #include <stdio.h> void main(void) { FILE *fp; int number; fp = fopen("visit-data", "r+"); fscanf(fp, "%d", &number); fseek(fp, 0, SEEK_SET); fprintf(fp, "%d\n", number+1); fclose(fp); printf("Content-type: text/x-server-parsed-html\n\n"); printf("%d", number); }

    GET ÀÇ ¹æ¹ýÀ» ÀÌ¿ëÇØ¼­ ¼­¹ö·Î µ¥ÀÌŸ¸¦ º¸³»´Â °æ¿ì´Â ¾î¶»°Ô µÉ±î? À̸§°ú ½ÅºÐÀ» ÀԷ¹޾Ƽ­ ±× ÀڷḦ ¼­¹ö·Î º¸³»·Á°í ÇÏ´Â °æ¿ì ´ÙÀ½ ±×¸²°ú °°ÀÌ ÀÔ·ÂÀ» ¹Þ´Â´Ù°í ÇÏÀÚ.

    ÀÌ·¯ÇÑ ½ÇÇà°á°ú¸¦ ¾ò±âÀ§Çؼ­ ÀÛ¼ºÇØ¾ß ÇÏ´Â HTML ¹®¼­´Â ¾Æ·¡¿Í °°´Ù. À­ ÇüÅÂó·³ »ç¿ëÀÚÀÇ ÀÔ·ÂÀ» ¹Þ´Â °ÍÀ» FORM À̶ó Çϴµ¥ À̿ܿ¡µµ ¸¹Àº ¸í·É¾î°¡ ÀÖ´Ù. FORM À» ¸¸µé±â À§ÇÑ ÀÚ¼¼ÇÑ ¼³¸íÀº »ý·«Çϵµ·Ï ÇÑ´Ù. ÀÚ¼¼ÇÑ °ÍÀº http://www.ncsa.uiuc.edu/SDG/Software/Masaic/Docs/fill-out-forms/overview.html ¸¦ ÂüÁ¶Çϵµ·Ï ÇÑ´Ù.

    <HTML> <BODY> <HR> <h1>It's test of CGI !!</h1> <FORM METHOD="GET" ACTION="/cgi-bin/print_result"> Name (English only) : <INPUT TYPE="text" NAME="NAME"> <br> Your Status : <br> <dd><INPUT TYPE="radio" NAME="STATUS" VALUE="Under Graduate Student"> Student(Under Graduate) <br> <dd><INPUT TYPE="radio" NAME="STATUS" VALUE="Graduate Student"> Student(Graduate) <br> <dd><INPUT TYPE="radio" NAME="STATUS" VALUE="Salesman"> Salesman <br> <p> <INPUT TYPE="submit" NAME="METHOD" VALUE="Register"> <INPUT TYPE="reset" NAME="METHOD" VALUE="Cancel"> </FORM> <HR> </BODY> </HTML> ¾Õ¿¡¼­ GET ÀÇ ¹æ½ÄÀ¸·Î ¼­¹ö¿¡¼­ ³Ñ°ÜÁØ µ¥ÀÌŸµéÀº QUERY_STRING À̶õ º¯¼ö¿¡ var1=value1&var2=value2 ÀÇ ÇüÅ·Π³Ñ°ÜÁö°Ô µÇ¸ç, ÇÁ·Î±×·¡¸ÓµéÀº º¯¼öÀÇ À̸§°ú °ªÀ» ºÐ¸®ÇØ ³»¾î¾ß ÇÑ´Ù°í ÇÏ¿´´Ù. ¾Æ·¡ÀÇ ÇÁ·Î±×·¥Àº ¼­¹ö°¡ µ¥ÀÌŸ¸¦ ¹ÞÀ»¶§ ¾î¶² Çü½ÄÀ¸·Î Àü´ÞÀÌ µÇ´ÂÁö¸¦ º¸¿©ÁÖ°í ½ÇÁ¦·Î º¯¼öÀÇ À̸§°ú °ªÀ» ºÐ¸®ÇØ ³½ °á°ú¸¦ Ãâ·ÂÇØ ÁØ´Ù.

    #include <stdio.h> main() { char *p; printf("Content-type:text/html\n\n"); printf("<HTML><BODY BGCOLOR=\"#ffffff\"> <h1> Result </H1>\n"); printf("Your web Browser is %s<P>\n", getenv("HTTP_USER_AGENT")); printf("Your Query is sended to server like this.<BR>"); printf("%s<P>\n", getenv("QUERY_STRING")); p = getenv("QUERY_STRING"); while( *p ) { if( *p == '=' ) printf(" Àº(´Â) "); else if( *p == '&' ) printf("ÀÔ´Ï´Ù.<BR>"); else if( *p == '+' ) printf(" "); else printf("%c", *p); p++; } printf("ÀÔ´Ï´Ù.</HTML>"); return(0); } À§ÀÇ CGI ¸¦ ½ÇÇà½ÃŲ °á°ú´Â ´ÙÀ½°ú °°´Ù.

    º¯¼ö¿Í ±× º¯¼ö°¡ °¡Áö°í ÀÖ´Â °ªÀ» ºÐ¸®ÇØÁÖ´Â ÇÁ·Î±×·¥Àº GET ÀÇ °æ¿ì¿Í POST ÀÇ °æ¿ì°¡ ´Ù¸£¸ç, NCSA ¿¡¼­ ¿©·¯°¡Áö ¾ð¾î·Î ÀÛ¼ºµÈ ÇÁ·Î±×·¥ (URL: http://hoohoo.ncsa.uiuc.edu/cgi/forms.html) À» °ø°³ÇØ ³õ¾ÒÀ¸¹Ç·Î À̸¦ ÀÌ¿ëÇÏ¸é °£´ÜÇÏ°Ô °á°ú¸¦ ¾òÀ» ¼ö ÀÖÀ» °ÍÀÌ´Ù.

    3.3 Make or Get ??

    ÀÌÁ¦±îÁö CGI ÀÇ ±âº»°³³ä°ú CGI ÇÁ·Î±×·¡¹Ö°ú ±âÁ¸ ÇÁ·Î±×¹Ö°úÀÇ Â÷ÀÌÁ¡À» ÅëÇØ¼­ CGI ¿¡ ´ëÇÑ ¸Àº¸±â¸¦ ÇØ º¸¾Ò´Ù. ±×·³ ´õ ¼¼·ÃµÈ ±â´ÉÀ» Á¦°øÇÏ´Â CGI ¸¦ ¾î¶»°Ô ÀÌ¿ëÇÒ °ÍÀΰ¡. Á÷Á¢ Â¥Áö ¸øÇÑ´Ù¸é ±âÁ¸¿¡ »ý¼ºµÈ CGI ´Â ÀÌ¿ëÇÒ ¼ö ¾ø´Â °ÍÀϱî? CGI ¸¦ ÀÌ¿ëÇϰíÀÚ ÇÏ´Â »ç¶÷µéÀ» À§Çؼ­ ¼ö¾øÀÌ ¸¹Àº WWW ÀÌ¿ëÀÚµéÀÌ CGI script archive (URL: http://worldwidemart.com/scripts) ¸¦ ¸¸µé¾î ³õ¾Æ¼­ ¸ðµç À̵éÀÌ ´Ù¾çÇÏ°í »õ·Î¿î Á¾·ùÀÇ CGI script ¸¦ ÀÌ¿ëÇÒ ¼ö ÀÖµµ·Ï ÇØ ³õ¾Ò´Ù.

    ¶ÇÇÑ CGI ÇÁ·Î±×·¡¹ÖÀ» ´õ ½±°Ô ÇØÁÖ±â À§Çؼ­ ¿©·¯°¡Áö Library °¡ Á¦°øµÇ°í ÀÖÀ¸¸ç ÇÊÀÚ°¡ ÀÚÁÖ ÀÌ¿ëÇÏ´Â C Library ´Â http://www.boutell.com/cgic ÀÌ´Ù. ÀÚ¼¼ÇÑ ³»¿ëÀº À§ÀÇ URL À» ÂüÁ¶Çϱ⠹ٶõ´Ù.

    4. "Waste" create Information : About Log Analyzer

    4.1 What can we do with Log files ?

    ¾Õ¿¡¼­ Web ¼­¹ö¸¦ ¿î¿µÇÏ´Â ¸ñÀû Áß Çϳª°¡ Á¤º¸ÀÇ Á¦°øÀÚ ¿ªÇÒÀ» ÇÏ´Â °ÍÀ̶ó°í ¾ð±ÞÇÑ ¹Ù ÀÖ´Ù. ±×·¸´Ù¸é WWW °ü¸®ÀÚµéÀº ±×Àú Á¤º¸¸¦ 'Á¦°ø'ÇÏ´Â °ÍÀ¸·Î ȤÀº Á¤º¸¸¦ Á¦°øÇÒ ¼ö ÀÖ´Â 'ȯ°æ'À» ¸¸µé¾îÁذÍÀ¸·Î ±×µéÀÇ ¿ªÇÒÀ» ´ÙÇÑ °ÍÀϱî?

    Áö°¢ÀÖ´Â WWW °ü¸®ÀÚ¶ó¸é ±×°¡ Á¦°øÇÑ Á¤º¸µéÀÌ ¾ó¸¶¸¸Å­ ÀÌ¿ëµÇ°í ÀÖ°í, ±×µéÀÇ Á¤º¸¸¦ ÇÊ¿ä·ÎÇÏ´Â »ç¶÷µéÀº ¾î¶² »ç¶÷µéÀ̸ç, ¾î¶² ÇüÅÂÀÇ ÀÚ·á°¡ °¡Àå ¸¹ÀÌ ÀÌ¿ëµÇ°í ÀÖ´À³Ä ÇÏ´Â ¿©·¯°¡Áö »ç½Ç¿¡ ´ëÇØ¼­ ±Ã±ÝÇØ ÇÒ °ÍÀ̰í, ±×¿¡ ´ëÇÑ °á°ú¸¦ ´õ ³ªÀº Á¤º¸ÀÇ Á¦°ø°ú ȯ°æÀÇ Á¦°øÀ̶ó´Â °Í¿¡ ÀÌ¿ëÇÔÀ¸·Î½á ´õ Çâ»óµÈ ¼­ºñ½º¸¦ ÇÏ°Ô µÉ °ÍÀÌ´Ù.

    ±×·¸´Ù¸é ÀÌ·± ±Ã±ÝÇÑ »ç½ÇµéÀ» ¾Ë¾Æº¼ ¼ö ÀÖÀ¸·Á¸é ¾î¶»°Ô ÇØ¾ßÇÒ °ÍÀΰ¡?

    ¼­¹ö¸¦ ±¸µ¿½Ã۸é ÀÚµ¿ÀûÀ¸·Î »ý¼ºµÇ´Â Log file µéÀÌ ÀÖ´Ù. À̰͵éÀº ±×´ë·Î ³õ¾ÆµÎ¸é °è¼ÓÇØ¼­ Å©±â°¡ Ä¿Á®¼­ ¾î¶³¶§´Â ½Ã½ºÅÛ¿¡ ÁöÀåÀ» Áֱ⵵ ÇÑ´Ù. ÇÏÁö¸¸ °ü¸®ÀÚÀÇ ÀÔÀå¿¡¼­ ÀÌ °ñÄ¡µ¢¾î¸®µéÀ» Á¶±Ý¸¸ ½Å°æ½á¼­ ¼ÕºÁÁشٸé, À§¿¡¼­ ±Ã±ÝÇØ Çß´ø Áú¹®¿¡ ´ëÇÑ ÇØ´äÀ» ÁÖ´Â ÀÚ·áµéÀ» ¸¸µé¾î ³¾ ¼ö ÀÖ´Ù.

    WWW °ü¸®ÀÚµéÀÌ Log file µé¿¡ °ü½ÉÀ» °¡Á®¾ß ÇÏ´Â ÀÌÀ¯´Â ¾Æ·¡¿Í °°´Ù.

    4.2 What do I know 'analyze' Log file ? : Prerequisite

    4.2.1 Basic Vocaburary

    Log file À» ºÐ¼®Çغ¸±â·Î ¸¶À½ ¸Ô¾ú´Ù¸é ´ÙÀ½¿¡ °áÁ¤ÇØ¾ß ÇÒ ¹®Á¦´Â ¾îµð¼­ ºÎÅÍ ½ÃÀÛÇÒ °ÍÀΰ¡ÀÌ´Ù. Log file À» ºÐ¼®Çϱâ À§Çؼ­ ¸ÕÀú ÀÎÁöÇØ¾ßÇÒ ¸î°¡Áö »ç½Çµé¿¡ ´ëÇØ¼­ ¾Ë¾Æ º¸µµ·Ï ÇÏÀÚ.

    Tracking usage ¶ó´Â °ÍÀº °£´ÜÈ÷ ¸»ÇÏ¸é ¾ó¸¶³ª ¸¹Àº »ç¶÷µéÀÌ Æ¯Á¤ÇÑ Site ¸¦ ¹æ¹®Çß°í, ¹æ¹®ÇÑ µ¿¾È ¾ó¸¶³ª ¿À·¡µ¿¾È ¸Ó¹°·¶À¸¸ç ¾î¶² page °¡ °¡Àå À¯¸íÇѰ¡¸¦ ³ªÅ¸³»ÁÖ´Â ÀڷḦ ³ªÅ¸³»°í, Profiling User ´Â ³ªÀÌ, ¼º, Á÷¾÷, ±³À°Á¤µµ °°Àº »çȸ °æÁ¦ÀûÀÎ ÀÚ·áµéÀ» °¡Áö°í ÀÖ´Â »ç¿ëÀڵ鸦 ³ªÅ¸³½´Ù. Log ¸¦ ºÐ¼®Çϱâ À§Çؼ­ ¾Ë¾Æ¾ßÇÏ´Â ±âº»ÀûÀÎ ¸î°³ÀÇ ¾îÈÖ¿¡ ´ëÇØ¼­ ¤°í ³Ñ¾î°¡ÀÚ.

    4.2.2 Log files

    Access log

    ¸ðµç httpd ¼­¹öµéÀº Access logs ¸¦ ³²±â°Ô µÈ´Ù. ´ëºÎºÐÀÇ Web ¼­¹öµéÀº °øÅëÀûÀÎ Log file ÇüŸ¦ °¡Áö°í ÀÖ°í, ȤÀº °øÅëÀÇ ÇüÅ·Πº¯È¯ÇÒ ¼ö ÀÖµµ·Ï ¸¸µé¾î ³õ¾Ò´Ù. °øÅëÀÇ ÇüŰ¡ µÇ¾î¾ß Web ¼­¹öÀÇ »ç¿ëÅë°è¸¦ ³¾ ¼ö ÀÖ´Â Analyzer ÇÁ·Î±×·¥µéÀ» »ç¿ëÇÒ ¼ö Àֱ⠶§¹®ÀÌ´Ù. ÀüÇüÀûÀÎ Log file ÀÇ ÇüÅ´ ´ÙÀ½°ú °°´Ù.
    1. Client ÀÇ È£½ºÆ®À̸§À̳ª IP address
    2. User_Logname - º¸ÅëÀº "-" ·Î ´ëüµÈ´Ù.
    3. Authenticated_user - ÀÎÁõ ¿ä±¸°¡ ¾ø´Ù¸é "-" ·Î ´ëüµÈ´Ù.
    4. Á¢¼ÓÇÑ ½Ã°£°ú ³¯Â¥
    5. Client ÀÇ ¿ä±¸»çÇ×
    6. Server ÀÇ Ã³¸®»çÇ×
    7. º¸³»Áø byte ¼ö

    Server ÀÇ Ã³¸®»çÇ×Àº ¾Æ·¡¿Í °°Àº Code ·Î Log file ¿¡ ÀúÀåµÈ´Ù.

    1. 200 - OK - successful transmission
    2. 302 - Redirection to new URL
    3. 304 - Use local copy from cache
    4. 4xx - Client error: systex problem, unauthorized request, "not found"
    5. 5xx - Server error
    ´ÙÀ½Àº ½ÇÁ¦ÀÇ access_log È­ÀÏÁß¿¡¼­ ÃßÃâÇÑ ¿¹ÀÌ´Ù.
    hollywood.cs.washington.edu - - [09/Sep/1996:08:59:28 +0900] "GET /~shkim/persona
    l.htm HTTP/1.0" 200 167
    robot.taegu.ac.kr - - [09/Sep/1996:09:09:18 +0900] "GET /~shkim/ HTTP/V1.0" 200 3
    312
    magicweb.dacom.co.kr - - [09/Sep/1996:09:10:05 +0900] "GET /www/health.html HTTP/
    1.0" 200 11054
    magicweb.dacom.co.kr - - [09/Sep/1996:09:14:25 +0900] "POST /cgi-bin/nhealth.pl H
    TTP/1.0" 200 1436
    pjk.kaist.ac.kr - - [09/Sep/1996:09:15:08 +0900] "GET /~loveiris/ost.html HTTP/1.
    0" 200 3208
    cust57.max5.portland.or.ms.uu.net - - [09/Sep/1996:09:50:46 +0900] "GET /ktmp95/i
    cons/dots/or_diam.gif HTTP/1.0" 200 0
    
    ´ëºÎºÐÀÇ Log file Àº È£½ºÆ® À̸§À¸·Î ³ª¿ÀÁö ¾Ê°í IP address ·Î ³ª¿À´Â °æ¿ì°¡ ´õ ¸¹°Ô µÈ´Ù. ÀÌ·± °æ¿ì´Â Log file À» ºÐ¼®Çϴµ¥ »ó´çÈ÷ ¾î·Á¿òÀ» °ÞÀ» ¼ö°¡ ÀÖ´Ù. ±×·¯¹Ç·Î ÀÚ½ÅÀÌ ºÐ¼®ÇؾßÇÒ Log file ¿¡ IP address °¡ ¸¹ÀÌ ³ª¿ÍÀÖ´Ù¸é Unresolved IP address ¸¦ ó¸®ÇØ ÁÖ´Â ±â´ÉÀÌ ÀÖ´Â Analyzer ¸¦ ÀÌ¿ëÇØ¾ß ÇÒ °ÍÀÌ´Ù.

    Error log

    ½ÇÁ¦·Î ¸¹ÀÌ ¹«½ÃµÇ´Â °ÍÀÌ Error log Àε¥ Error log ´Â ¼­¹ö°¡ ¿Àµ¿ÀÛÀ» ÇÒ¶§ ¸¹Àº Á¤º¸¸¦ ÁÙ ¼ö ÀÖ´Ù. ¶ÇÇÑ, º¸¾È °ü¸®Ãø¸é¿¡¼­ Áß¿äÇÑ ¿ªÇÒÀ» ÇÑ´Ù. Áï, Cracking À» ½ÃµµÇÑ »ç¿ëÀÚµéÀÇ ±â·ÏÀº access log ¿¡ ³²¾ÆÀÖÁö ¾Ê°í ÀÌ È­ÀÏ¿¡ ±â·ÏµÇ±â ¶§¹®ÀÌ´Ù. ´ÙÀ½Àº Error log ÀÇ ½ÇÁ¦ ¿¹ÀÌ´Ù.
    [Wed Oct 16 12:54:18 1996] httpd: send aborted for simac.kaist.ac.kr
    [Wed Oct 16 13:03:11 1996] httpd: send aborted for martingale.kaist.ac.kr
    [Wed Oct 16 13:03:11 1996] httpd: send aborted for simac.kaist.ac.kr
    [Wed Oct 16 13:03:15 1996] httpd: send aborted for 203.231.224.100
    [Wed Oct 16 13:05:52 1996] httpd: access to /home1/grad/jkhong/Home/icon
       /lipurple.gif failed for 165.246.11.96, reason: file does not exist from 
       http://ktmp.kaist.ac.kr/~jkhong/Sports.html
    [Wed Oct 16 13:06:50 1996] httpd: send aborted for 168.126.246.120
    

    Referer log

    ¼­¹öÀÇ ¹®¼­¸¦ ÂüÁ¶ÇÏ´Â ¹®¼­¿¡ ´ëÇÑ log ¸¦ URI -> Document ÀÇ ÇüÅ·Π±â·ÏÇϸç URI ´Â ¼­¹öÀÇ ÀڷḦ ÂüÁ¶ÇÏ´Â Universal Resource Identifier À̸ç, Document ´Â ÂüÁ¶µÇ´Â ¹®¼­ÀÇ DocumentRoot ¿¡¼­ÀÇ »ó´ëÀûÀÎ °æ·Î·Î ³ªÅ¸³½´Ù. ½ÇÁ¦ Referrer_log ÀÇ ¿¹´Â ´ÙÀ½°ú °°´Ù.
    http://ktmp.kaist.ac.kr/~shlee/ -> /~shlee/bullet2.gif
    http://ktmp.kaist.ac.kr/~shlee/ -> /~shlee/note.gif
    http://ktmp.kaist.ac.kr/~shlee/ -> /~shlee/bullet5.gif
    http://ktmp.kaist.ac.kr/~shlee/ -> /~shlee/cals.htm
    

    Agent log

    Web ¼­¹ö¿¡ Á¢¼ÓÇÑ Client Software ³ª Browser ÀÇ Á¾·ù¸¦ ±â·ÏÇÏ´Â È­ÀÏÀÌ´Ù. ¿¹´Â ¾Æ·¡¿Í °°´Ù.
    Mozilla/2.01 (Win16; I)
    Mozilla/2.0 (X11; I; SunOS 4.1.3-KL sun4m)
    Mozilla/3.0b5a (Win95; I)
    WinPlay3
    Mozilla/2.0 (compatible; MSIE 3.0; Windows 95)
    Mozilla/3.0 (Win95; I)
    SimBot/1.0
    Mozilla/2.02 (X11; I; HP-UX A.09.05 9000/712)
    Mozilla/2.0 (compatible; MSIE 3.0; Windows 95)
    Mozilla/2.02 (X11; I; HP-UX A.09.05 9000/712)
    Mozilla/2.0 (X11; I; SunOS 4.1.3-KL sun4m)
    
    ´ëºÎºÐÀÇ Freeware Log analyzer ´Â access log ¸¦ Á¦¿ÜÇÑ ´Ù¸¥ log È­ÀϵéÀ» ¹«½ÃÇÏÁö¸¸ »ó¿ë software ÀÇ °æ¿ì¿¡´Â ¸ðµç log È­ÀϵéÀ» ´Ù°¢ÀûÀ¸·Î ºÐ¼®ÇÏ¿© ´õ ¸¹Àº Á¤º¸¸¦ À¯ÃßÇØ ³¾ ¼ö ÀÖ´Ù.

    4.3 How to set up your web site for log analysis

    ÀÌÁ¦±îÁö Log ¸¦ ºÐ¼®Çϱâ À§ÇÑ ¿©·¯°¡Áö °Íµé¿¡ ´ëÇØ¼­ ¾Ë¾Æº¸¾Ò´Ù. ±×·¯¸é Log ºÐ¼®À» ½±°Ô ÇÒ¼ö ÀÖ°Ô Çϱâ À§Çؼ­ WWW °ü¸®ÀÚ°¡ ½Å°æ½á¾ß ÇÒ ºÎºÐÀº ¾î¶² °ÍµéÀÌ ÀÖ´ÂÁö ¸î°¡Áö·Î ±¸ºÐÀ» ÇØ¼­ ¾Ë¾Æº¸µµ·Ï ÇϰڴÙ.

    4.4 Source of log analysis software and services

    4.4.1 What's the condition?

    ¼­¹ö Åë°è ºÐ¼®±â¸¦ »ç¿ëÇϱâ Àü¿¡ ¸î °¡Áö °í·ÁµÇ¾î¾ß ÇÒ »çÇ×Àº ´ÙÀ½°ú °°´Ù. ¸¸¾à Public Domain Software À» ¾òÀ» ¼ö ¾ø´Ù¸é »ó¿ë ÇÁ·Î±×·¥ÀÇ µµÀÔÀ» °í·ÁÇÏ¿©¾ß Çϴµ¥ »ó¿ë ÇÁ·Î±×·¥ÀÇ °æ¿ì´Â ¼º´É»Ó ¾Æ´Ï¶ó »ç¿ëÀÇ Æí¸®¼º µî ¿©·¯°¡Áö ´Ù¾çÇÑ Á¶°ÇÀ» °®Ãß°í ÀÖ´ÂÁö È®ÀÎÀ» ÇÏ¿©¾ß ÇÒ °ÍÀÌ´Ù. »ó¿ë ÇÁ·Î±×·¥ÀÌ °®Ãß¾î¾ß ÇÒ Á¶°Ç¿£ ´ÙÀ½°ú °°Àº°ÍÀÌ ÀÖ´Ù. À§¿¡ ¿­°ÅµÈ ¿©·¯°¡Áö Á¶°ÇµéÀ» ±âÁØÀ¸·ÎÇØ¼­ »ç¿ë ¸ñÀû°ú »çÁ¤¿¡ ¸Â´Â Software ¸¦ ¼±ÅÃÇØ¼­ »ç¿ëÇÏ´Â °ÍÀÌ ¹Ù¶÷Á÷ÇÏ´Ù.

    4.4.2 Getstat.C

    1993³â 6¿ù Honolulu Community ´ëÇп¡¼­ °³¹ßÇÑ getsites °¡ ¹öÀü¾÷ µÇ¸é¼­ getstats ·Î ¹Ù²î°Ô µÇ¾ú´Ù. ÇöÀçÀÇ ¹öÀüÀº 1.2 À̰í, Kevin Huges(kevinh@eit.com) ¿¡ ÀÇÇØ¼­ C ¾ð¾î·Î ÀÛ¼ºµÇ¾ú´Ù.

    ¿©·¯°³ÀÇ Log Analyzer Áß¿¡¼­ °¡Àå ¼º´É (URL: http://www.uu.se/Software/Getstats/Performance .html") ÀÌ ¶Ù¾î³ª°í, »ç¿ëÀÌ °¡Àå °£ÆíÇÑ ÇÁ·Î±×·¥À̸ç, CERN, NCSA, GN, MacHTTP ¼­¹öµéÀÇ Log file µéÀ» ºÐ¼®ÇÒ ¼ö ÀÖ´Ù.

    ¶ÇÇÑ getstats ´Â Public Domain Program ÀÌ ¾Æ´ÏÁö¸¸ ÇÁ·Î±×·¥À» ¼öÁ¤ÇÏÁö ¾ÊÀº ÇÑ ÀÚÀ¯·Ó°Ô ¹èÆ÷ÇÏ¿© »ç¿ëÇÒ ¼ö ÀÖµµ·Ï µÇ¾îÀÖÀ½À» ¾Ë¾ÆµÎ¾î¾ß ÇÑ´Ù.

    4.4.3 Case Study: Log file Analysis

    getstat ¸¦ »ç¿ëÇØ¼­ ½ÇÁ¦·Î ¿î¿µµÇ°í ÀÖ´Â ktmp.kaist.ac.kr ÀÇ Log file µéÀ» ºÐ¼®ÇØ º¸°í ºÐ¼® °á°ú¸¦ Åä´ë·Î ktmp ¼­¹öÀÇ ¾ÕÀ¸·ÎÀÇ ¿î¿µ¹æ¾Èµî¿¡ ´ëÇØ¼­ »ìÆì º¸µµ·Ï ÇÑ´Ù.
     
    % getstats -c -l access_log -N -M 
    HTTP Server General Statistics
    Server: http://www.eit.com/ (NCSA Common)
    Local date: Wed Oct 16 07:02:53 AM GMT 1996
    Covers: 09/09/96 to 10/16/96 (38 days).
    All dates are in local time.
    Requests last 7 days: 31105
    New unique hosts last 7 days: 1233
    Total unique hosts: 6519
    Number of HTML requests: 33576
    Number of script requests: 5332
    Number of non-HTML requests: 144546
    Number of malformed requests (all dates): 56638
    Total number of all requests/errors: 240092
    Average requests/hour: 268.7, requests/day: 6448.3
    Running time: 65 minutes, 19 seconds.
    
    ±×·³ À§ÀÇ °á°ú¸¦ Çϳª¾¿ »ìÆìº¸µµ·Ï ÇÏÀÚ.

    ºÐ¼®¿¡ »ç¿ëµÈ access_log È­ÀÏÀº Áö³­ 9¿ù 9ÀϺÎÅÍ 10¿ù 16ÀÏ ±îÁö 38Àϵ¿¾È ±â·ÏµÈ °ÍÀ̶ó´Â°ÍÀ» ¾Ë ¼ö ÀÖ°í, ÃÖ±Ù 7ÀÏ µ¿¾È Á¢¼ÓÇÑ »õ·Î¿î È£½ºÆ®µéÀÌ Àüü 6500 ¿©°³ÀÇ È£½ºÆ®Áß¿¡¼­ 1233 °³¸¦ Â÷ÁöÇϰí ÀÖÀ¸¹Ç·Î Áö³­ 1ÁÖÀϵ¿¾È »õ·Î¿î °÷¿¡¼­ÀÇ Á¢¼ÓÀÌ Áõ°¡ÇÏ¿´À½À» ¾Ë ¼ö ÀÖ´Ù.

    À߸øµÈ ¿ä±¸°¡ µé¾î¿Â °ÍÀÌ ÀüüÀÇ ¾à 25% Á¤µµ µÇ¹Ç·Î ktmp ¼­¹ö´Â ¾ÕÀ¸·Î Error Document ¸¦ Á¤ºñÇØ¾ß ÇÒ Çʿ䰡 ÀÖ´Ù°í ÆÇ´ÜµÈ´Ù. ¶ÇÇÑ, HTML ¿¡ ´ëÇÑ ¿ä±¸º¸´Ù´Â ´Ù¸¥ ¼­ºñ½º¿¡ ´ëÇÑ ¿ä±¸°¡ ¸¹Àº °ÍÀ¸·Î ³ªÅ¸³µ´Ù. Áï, HTML ¹®¼­¿¡ ´ëÇÑ »ç¿ëÀÚµéÀÇ Èï¹Ì°¡ Àû´Ù´Â °ÍÀ» º¸¿©Áشٰí ÇÒ ¼ö ÀÖÀ¸¹Ç·Î HTML ¹®¼­¸¦ ÀçÁ¤ºñÇÒ Çʿ伺µµ ¾î´À Á¤µµ ÀÖ´Ù°í »ý°¢µÈ´Ù.

    ----------------------------------------------
    
    HTTP Server Domain Statistics
    Covers: 09/09/96 to 10/16/96 (38 days).
    All dates are in local time.
    1 level, sorted by number of requests, 45 unique domains.
    
    # reqs : # uniq : Last Access (M/D/Y) : Domain
    ----------------------------------------------
    
    85400 : 1246 : 10/16/96 : .kr
    81612 : 3886 : 10/16/96 : (numerical domains)
     9400 :  427 : 10/16/96 : .net
     2360 :  357 : 10/16/96 : .com
     2039 :  203 : 10/16/96 : .edu
      357 :   54 : 10/15/96 : .jp
      321 :   48 : 10/15/96 : .au
      285 :   35 : 10/15/96 : .se
      269 :   51 : 10/16/96 : .ca
      241 :   28 : 10/16/96 : .uk
      121 :   18 : 10/15/96 : .org
      113 :    8 : 10/16/96 : .fr
      101 :    6 : 09/30/96 : .sg
       98 :    8 : 10/16/96 : .mil
       94 :   20 : 10/15/96 : .de
       93 :   15 : 10/15/96 : .no
       78 :   14 : 10/10/96 : .fi
       64 :   13 : 10/15/96 : .nl
       48 :    4 : 10/15/96 : .cl
       44 :    8 : 10/15/96 : .us
       40 :    3 : 10/10/96 : .ie
       37 :    9 : 10/07/96 : .nz
       35 :    8 : 10/12/96 : .gov
       30 :    4 : 10/12/96 : .br
       29 :    4 : 09/19/96 : .es
       26 :    4 : 10/01/96 : .is
       24 :    5 : 10/04/96 : .my
       20 :    1 : 10/05/96 : .ar
       16 :    1 : 10/07/96 : .kw
       14 :    4 : 10/10/96 : .il
       10 :    1 : 09/17/96 : .gr
        6 :    1 : 10/16/96 : unknown_host
        5 :    5 : 10/15/96 : .za
        4 :    3 : 09/30/96 : .in
        4 :    4 : 09/26/96 : .hk
        3 :    1 : 10/04/96 : .si
        3 :    2 : 10/03/96 : .pt
        2 :    2 : 10/02/96 : .be
        2 :    2 : 09/26/96 : .it
        1 :    1 : 10/12/96 : .at
        1 :    1 : 10/09/96 : .pe
        1 :    1 : 10/08/96 : .cz
        1 :    1 : 09/18/96 : .ch
        1 :    1 : 09/12/96 : .id
        1 :    1 : 09/11/96 : .dk
    
    ----------------------------------------------
    
    
    ¿ª½Ã .kr µµ¸ÞÀο¡¼­ÀÇ Á¢¼ÓÀÌ °¡Àå ¸¹Àº °ÍÀ¸·Î ³ªÅ¸³µ°í, ÀǿܷΠ.edu ³ª .com, .net µµ¸ÞÀο¡¼­ÀÇ Á¢¼ÓÀÌ »ó´çºÎºÐÀ» Â÷ÁöÇϰí ÀÖ´Ù´Â °ÍÀ» º¸¾ÒÀ»¶§ ¿Ü±¹¿¡¼­ÀÇ Á¢¼Óµµ ¾î´À Á¤µµ ÀÌ·ç¾îÁö°í ÀÖ´Ù°í ºÁ¾ßÇÑ´Ù.

    Áï, ktmp ÀÇ WWW Home page °¡ ¿µ¾î·Î µÇ¾î ÀÖÁö ¾Ê´Ù¸é ¿µ¾î·Î µÈ Home page ¸¦ ¸¸µé¾î¾ß ÇÒ Çʿ伺ÀÌ ´ëµÎµÈ´Ù°í ÇÒ ¼ö ÀÖ´Ù.

    HTTP Server Daily Summary
    Covers: 09/09/96 to 10/16/96 (38 days).
    All dates are in local time.
    
    Each mark (#) represents 100 requests.
    ----------------------------------------------
    
       Mon: 28953 : ##########################################################||###
       Tue: 39587 : ##########################################################||###
       Wed: 33223 : ##########################################################||###
       Thu: 24582 : ##########################################################||###
       Fri: 23446 : ##########################################################||###
       Sat: 21049 : ##########################################################||###
       Sun: 12614 : ##########################################################||###
    
    ----------------------------------------------
    
    À§ÀÇ ¿äÀϺ° Á¢±Ù Ƚ¼ö ºÐ¼® °á°ú¸¦ º¸¸é ´Ù¸¥ ¿äÀÏ¿¡ ºñÇØ¼­ È­¿äÀÏ¿¡ Á¢¼ÓÀ» ¸¹ÀÌ Çϰí ÀÖÀ½ÀÌ ³ªÅ¸³­´Ù. ±×·¯¹Ç·Î Web °ü¸®ÀÚ´Â È­¿äÀÏ¿¡ ¼­¹ö ½ÇÆÐ°¡ ³ªÅ¸³ªÁö ¾Ê°Ô ½Å°æÀ» ½á¾ß ÇÒ °ÍÀ̰í, À¯Áöº¸¼ö µîµµ È­¿äÀÏÀ» ÇÇÇØ¼­ ÇÏ´Â °ÍÀÌ ³ªÀ» °ÍÀÌ´Ù.

    À§¿¡¼­ ¸î°¡Áö ºÐ¼® °á°ú¿¡ ´ëÇØ¼­ À¯ÃßÇÒ ¼ö ÀÖ´Â °£´ÜÇÑ »ç½Ç¿¡ ´ëÇØ¼­ ¾Ë¾Æº¸¾Ò´Ù. À§¿¡¼­ ±â¼úÇÑ À¯ÃßÇÑ »ç½ÇÀÌ ¿Ü¿¡µµ ´Ù¸¥ ¸¹Àº »ç½ÇµéÀ» À¯ÃßÇØ ³»¾î Web ¼­¹ö °ü¸®ÀÚ °¡ ´õ ÁÁÀº ¼­ºñ½º¸¦ ÇϱâÀ§Çؼ­ ÀÌ¿ëÇÒ ¼öµµ ÀÖÀ» °ÍÀÌ´Ù.

    ¶ÇÇÑ Agent_log, Error_log, Referrer_log µîÀÇ È­ÀϵéÀ» ºÐ¼®ÇÏ¿© Access_log ºÐ¼® °á°ú¿Í ¿¬°üÀ» ½ÃÅ´À¸·Î¼­ »õ·Î¿î Á¤º¸¸¦ ¾ò¾î³¾ ¼öµµ ÀÖÀ» °ÍÀÌ´Ù.

    °á·ÐÀûÀ¸·Î Log file µéÀ» ±×´ë·Î ½×¾ÆµÎ±â¸¸ ÇØ¼­ ½Ã½ºÅÛÀÇ ÀÚ¿øÀ» Â÷ÁöÇÏ´Â ÁüÀ¸·Î ¸¸µé°ÍÀÌ ¾Æ´Ï¶ó À̸¦ È¿À²ÀûÀ¸·Î °ü¸®ÇÏ¿© Web ¼­¹ö°¡ ´õ ÁÁÀº ¼­ºñ½º¸¦ Á¦°øÇϴµ¥ µµ¿òÀÌ µÇµµ·Ï ÀÌ¿ëÇÏ´Â °ÍÀÌ ¹Ù¶÷Á÷ÇÏ´Ù ÇÒ °ÍÀÌ´Ù.

    5. Conclusion

    º» ¹®¼­¿¡¼­´Â WWW server ÀÇ ±¸Ãà Çʿ伺°ú APACHE server ÀÇ ½ÇÁ¦ Setup °úÁ¤À» Configuration °úÁ¤°ú ÇÔ²² ÀÚ¼¼ÇÏ°Ô ¼³¸íÇÏ¿´´Ù. ±×¸®°í CGI ÀÇ °³³ä°ú °£´ÜÇÑ CGI ÇÁ·Î±×·¡¹Ö¿¡ ´ëÇØ¼­ ¾ð±ÞÇÏ¿´°í, HTTP server ¸¦ ¿î¿µÇÒ¶§ »ý±â´Â Log file µé¿¡ ´ëÇØ ¼³¸íÇϰí, ±×°ÍµéÀÇ ºÐ¼® Çʿ伺À» ³íÇϰí, ½ÇÁ¦ ºÐ¼® ÇÁ·Î±×·¥ÀÇ »ç¿ë¹ý¿¡ ´ëÇØ °£´ÜÈ÷ ¼³¸íÇÏ¿´´Ù. ½ÇÁ¦ Log file µéÀ» ºÐ¼®ÇÔÀ¸·Î½á ±×°ÍÀ¸·ÎºÎÅÍ À¯Ãߵɼö ÀÖ´Â Á¤º¸¿¡ ´ëÇØ¼­ ¾Ë¾Æº¸¾Ò´Ù.

    ¾ÕÀ¸·Î ÃÖ½ÅÀÇ Á¤º¸³ª À߸øµÈ »çÇ×ÀÌ ÀÖÀ¸¸é ¼ö½Ã·Î °íÃijª°¥ °èȹÀ̰í ÀÌ ¹®¼­¿¡ ´ëÇÑ Comment ´Â ¾ðÁ¦µçÁö ȯ¿µÇϸç loveiris@ktmp.kaist.ac.kr ·Î º¸³»¸é µÈ´Ù. Update µÈ ¹®¼­ÀÇ URL Àº ´ÙÀ½°ú °°´Ù.
    http://ktmp.kaist.ac.kr/~loveiris/seminar/A22.html

    Reference

    [McGrath 95] [Noonan 96] [qkim 95] [jwjung 95]

    Foot Notes

    (2)
    Content Negotiation ¶ó´Â °ÍÀº Client ¿Í Server °¡ ¼­·Î ÇùÀÇÇÏ¿© Client Ãø¿¡¼­ 󸮰¡´ÉÇÑ °´Ã¼ ÇüÅÂ, ºÎȣȭ, ÀÚ¿¬¾î µîÀ» ¼­¹ö°¡ °ñ¶ó¼­ Á¦°øÇØ ÁÖ´Â °ÍÀ» ÀǹÌÇϸç HTTP/1.1 ¿¡¼­ ±¸ÇöµÇ¾ú´Ù. Client Ãø¿¡¼­ gif Çü½ÄÀÇ È­ÀÏÀ» ¿øÇÒ¶§ ¼­¹ö¿¡¼­ µÇµµ·ÏÀ̸é gif ÇüÅÂÀÇ È­ÀÏÀ» º¸³»ÁÖ´Â °ÍÀÌ ±× ¿¹ÀÌ´Ù.


    * Last_Modified : Tuesday, 09-Dec-2014 17:25:31 UTC
    and Your Web Browser is Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)