<-
Apache > HTTP Server > Documentation > Version 2.2 > ¸ðµâ

Please note

This document refers to a legacy release (2.2) of Apache httpd. The active release (2.4) is documented here. If you have not already upgraded, please follow this link for more information.

You may follow this link to go to the current version of this document.

¾ÆÆÄÄ¡ ¸ðµâ mod_cgi

°¡´ÉÇÑ ¾ð¾î:  en  |  ja  |  ko 

ÀÌ ¹®¼­´Â ÃÖ½ÅÆÇ ¹ø¿ªÀÌ ¾Æ´Õ´Ï´Ù. ÃÖ±Ù¿¡ º¯°æµÈ ³»¿ëÀº ¿µ¾î ¹®¼­¸¦ Âü°íÇϼ¼¿ä.
¼³¸í:CGI ½ºÅ©¸³Æ® ½ÇÇà
»óÅÂ:Base
¸ðµâ¸í:cgi_module
¼Ò½ºÆÄÀÏ:mod_cgi.c

¿ä¾à

¼­¹ö´Â mime typeÀÌ application/x-httpd-cgiÀ̰ųª (¾ÆÆÄÄ¡ 1.1 ÀÌÈÄ) Çڵ鷯°¡ cgi-scriptÀÎ ¸ðµç ÆÄÀÏÀ» CGI ½ºÅ©¸³Æ®·Î ÀνÄÇÏ¿©, ½ÇÇàÇÏ°í, ±× °á°ú¸¦ Ŭ¶óÀ̾ðÆ®¿¡°Ô º¸³½´Ù. ÆÄÀÏÀÌ AddType Áö½Ã¾î·Î ÁöÁ¤ÇÑ È®ÀåÀÚ¸¦ °¡Áö°Å³ª, ScriptAlias µð·ºÅ丮 ¾È¿¡ ÀÖÀ¸¸é CGI·Î 󸮵ȴÙ.

¼­¹ö´Â CGI ½ºÅ©¸³Æ®¸¦ ºÎ¸¦¶§ DOCUMENT_ROOT¶ó´Â ȯ°æº¯¼ö¸¦ Ãß°¡ÇÑ´Ù. ÀÌ º¯¼ö´Â DocumentRoot ¼³Á¤°ªÀ» °¡Áø´Ù.

¾ÆÆÄÄ¡¿¡¼­ CGI ½ºÅ©¸³Æ®¸¦ »ç¿ëÇÏ´Â ¹æ¹ý¿¡ ´ëÇÑ ¼Ò°³´Â CGI·Î µ¿Àû ÆäÀÌÁö »ý¼º ÅõÅ丮¾óÀ» Âü°íÇ϶ó.

À¯´Ð½º¿¡¼­ ´ÙÁß¾²·¹µå MPMÀ» »ç¿ëÇÑ´Ù¸é ÀÌ ¸ðµâ´ë½Å mod_cgid ¸ðµâÀ» »ç¿ëÇØ¾ß ÇÑ´Ù. »ç¿ëÀÚ ÀÔÀå¿¡¼­ ÀÌ µÎ ¸ðµâÀº ±âº»ÀûÀ¸·Î µ¿ÀÏÇÏ´Ù.

ÁÖÁ¦

Áö½Ã¾îµé

Âü°í

top

CGI ȯ°æº¯¼ö

¼­¹ö´Â ´ÙÀ½°ú °°Àº ¹æ¹ýÀ¸·Î CGI Ç¥ÁØÀÌ ¼³¸íÇÏ´Â CGI ȯ°æº¯¼ö¸¦ ¼³Á¤ÇÑ´Ù:

PATH_INFO
ÀÌ º¯¼ö´Â AcceptPathInfo Áö½Ã¾î¸¦ Á÷Á¢ off·Î ÁöÁ¤ÇÑ °æ¿ì¿¡¸¸ ¼³Á¤ÇÑ´Ù. AcceptPathInfo°¡ ¾ø´Â °æ¿ì ¼­¹ö´Â ±âº»ÀûÀ¸·Î °æ·Î Á¤º¸°¡ ÀÖ´Â ¿äû¿¡ ´ëÇØ 404 NOT FOUND ¿À·ù¸¦ ³»Áö¸¸, mod_cgi´Â °æ·Î Á¤º¸¸¦ (URI¿¡¼­ ½ºÅ©¸³Æ® ÆÄÀÏ¸í µÚ¿¡ ³ª¿À´Â /more/path/info) ¹Þ´Â´Ù. AcceptPathInfo Áö½Ã¾î¸¦ »ý·«Çϸé mod_cgi ¿äû¿¡ ´ëÇؼ­ AcceptPathInfo¸¦ OnÀ¸·Î ¼³Á¤ÇÑ °Í°ú °°´Ù.
REMOTE_HOST
ÀÌ º¯¼ö´Â HostnameLookups°¡ onÀÌ°í (±âº»°ªÀº off), Á¢¼ÓÇÑ È£½ºÆ® ÁÖ¼Ò¸¦ ¿ªDNS °Ë»öÇÏ¿© ½ÇÁ¦ È£½ºÆ®¸íÀ» ãÀº °æ¿ì¿¡¸¸ ¼³Á¤ÇÑ´Ù.
REMOTE_IDENT
ÀÌ º¯¼ö´Â IdentityCheck°¡ onÀÌ°í, Á¢¼ÓÇÑ È£½ºÆ®°¡ ident ÇÁ·ÎÅäÄÝÀ» Áö¿øÇÏ´Â °æ¿ì¿¡¸¸ ¼³Á¤ÇÑ´Ù. ½±°Ô ÀÌ °ªÀ» ¼ÓÀÏ ¼ö Àֱ⶧¹®¿¡ ÀÌ º¯¼öÀÇ ³»¿ëÀ» ¹ÏÀ¸¸é ¾ÈµÇ°í, Ŭ¶óÀ̾ðÆ®¿Í ¼­¹ö »çÀÌ¿¡ ÇÁ·Ï½Ã°¡ ÀÖ´Ù¸é º¯¼ö ³»¿ëÀÌ ¿ÏÀüÈ÷ ¹«ÀǹÌÇÔÀ» ÁÖÀÇÇ϶ó.
REMOTE_USER
CGI ½ºÅ©¸³Æ®°¡ ÀÎÁõÀ» °ÅÃľßÇÏ´Â °æ¿ì¿¡¸¸ ¼³Á¤ÇÑ´Ù.
top

CGI µð¹ö±ë

¾îµð¿¡¼­ À߸ø ½ÇÇàµÇ´ÂÁö ½ºÅ©¸³Æ®ÀÇ Ãâ·ÂÀ» (Ç¥ÁØÃâ·Â°ú Ç¥ÁØ¿À·ù) º¼ ¼ö ¾ø±â¶§¹®¿¡ CGI ½ºÅ©¸³Æ®´Â ÀüÅëÀûÀ¸·Î µð¹ö±ëÇϱ⠾î·Á¿ü´Ù. ¾ÆÆÄÄ¡ 1.2 ÀÌÈÄ¿¡ Ãß°¡µÈ Áö½Ã¾î¸¦ »ç¿ëÇÏ¸é ¹ß»ýÇÑ ¿À·ù¸¦ ÀÚ¼¼È÷ ·Î±×¿¡ ³²±æ ¼ö ÀÖ´Ù.

CGI ·Î±×ÆÄÀÏ Çü½Ä

CGI ¿À·ù·Î±×´Â Á¤»óÀûÀ¸·Î ½ÇÇàÇÏÁö ¸øÇÑ CGI¸¦ ±â·ÏÇÑ´Ù. ¿À·ù°¡ ¹ß»ýÇÑ CGI ½ºÅ©¸³Æ®´Â ·Î±×¿¡ ¿©·¯ ÁÙÀÇ Á¤º¸¸¦ ³²±ä´Ù. ù¹ø° µÎ ÁÙÀº Ç×»ó ¾Æ·¡¿Í °°Àº Çü½ÄÀÌ´Ù:

%% [½Ã°£] ¿äûÁÙ
%% HTTP-»óÅ CGI-½ºÅ©¸³Æ®-ÆÄÀϸí

CGI ½ºÅ©¸³Æ®¸¦ ½ÇÇàÇÒ ¼ö ¾ø´Â ¿À·ùÀÎ °æ¿ì ·Î±×ÆÄÀÏ¿¡ Ãß°¡·Î µÎ ÁÙÀ» ´õ ±â·ÏÇÑ´Ù:

%%error
¿À·ù¹®

½ºÅ©¸³Æ®°¡ (º¸Åë ½ºÅ©¸³Æ®ÀÇ ¹ö±×¶§¹®¿¡) À߸øµÈ Çì´õ Á¤º¸¸¦ ¹ÝȯÇÏ´Â °æ¿ì, ´ÙÀ½ ³»¿ëÀ» ·Î±×¿¡ ±â·ÏÇÑ´Ù:

%request
¹ÞÀº ¸ðµç HTTP Çì´õ
(ÀÖ´Ù¸é) POST³ª PUT ³»¿ë
%response
CGI ½ºÅ©¸³Æ® Ãâ·ÂÀÇ ¸ðµç Çì´õ
%stdout
CGI Ç¥ÁØÃâ·Â
%stderr
CGI Ç¥ÁØ¿À·ù

(½ºÅ©¸³Æ®°¡ Ç¥ÁØÃâ·ÂÀ̳ª Ç¥ÁØ¿À·ù¿¡ ¾Æ¹« ³»¿ëµµ Ãâ·ÂÇÏÁö ¾Ê¾Ò´Ù¸é %stdout°ú %stderr ºÎºÐÀº »ý·«µÉ ¼ö ÀÖ´Ù).

top

ScriptLog Áö½Ã¾î

¼³¸í:CGI ½ºÅ©¸³Æ® ¿À·ù·Î±×ÆÄÀÏÀÇ À§Ä¡
¹®¹ý:ScriptLog file-path
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®
»óÅÂ:Base
¸ðµâ:mod_cgi, mod_cgid

ScriptLog Áö½Ã¾î´Â CGI ½ºÅ©¸³Æ® ¿À·ù·Î±×ÆÄÀÏÀ» ÁöÁ¤ÇÑ´Ù. ScriptLog¸¦ »ç¿ëÇÏÁö¾ÊÀ¸¸é ¿À·ù·Î±×¸¦ ¸¸µéÁö ¾Ê´Â´Ù. »ç¿ëÇÏ¸é ¾Æ±Ô¸ÕÆ®·Î ÁöÁ¤ÇÑ ÆÄÀÏ¿¡ CGI ¿À·ù¸¦ ±â·ÏÇÑ´Ù. »ó´ë°æ·Î¸¦ ÁöÁ¤Çϸé ServerRoot¿¡ »ó´ë°æ·Î·Î ¹Þ¾ÆµéÀδÙ.

¿¹Á¦

ScriptLog logs/cgi_log

ÀÚ½Ä ÇÁ·Î¼¼½º¸¦ ½ÇÇàÇÏ´Â »ç¿ëÀÚ, Áï User Áö½Ã¾î·Î ÁöÁ¤ÇÑ »ç¿ëÀÚ ±ÇÇÑÀ¸·Î ·Î±×¸¦ ¿¬´Ù. ±×·¡¼­ ±× »ç¿ëÀÚ°¡ ½ºÅ©¸³Æ® ·Î±×°¡ ÀÖ´Â µð·ºÅ丮¿¡ ¾²±â±ÇÇÑÀÌ ÀÖ´øÁö, Á÷Á¢ ¹Ì¸® ÆÄÀÏÀ» ¸¸µé¾î¼­ ±× »ç¿ëÀÚ¿¡°Ô ¾²±â±ÇÇÑÀ» Áà¾ß ÇÑ´Ù. ½ºÅ©¸³Æ® ·Î±×¸¦ ÁÖ ·Î±× µð·ºÅ丮¿¡ µÐ´Ù¸é ÀÚ½Ä ÇÁ·Î¼¼½º¸¦ ½ÇÇàÇÏ´Â »ç¿ëÀÚ¿¡°Ô ¾²±â±ÇÇÑÀ» ÁÖ±âÀ§ÇØ µð·ºÅ丮 ±ÇÇÑÀ» º¯°æÇÏÁö ¸¶¶ó.

½ºÅ©¸³Æ® ·Î±×´Â CGI ½ºÅ©¸³Æ®¸¦ ÀÛ¼ºÇÒ¶§ µð¹ö±ëÀ» À§ÇÑ ¿ëµµÀÌÁö ¼­¹ö¸¦ ½ÇÇàÇÏ´Â µ¿¾È °è¼Ó »ç¿ëÇϱâÀ§ÇÔÀÌ ¾Æ´ÔÀ» ÁÖÀÇÇ϶ó. ¼Óµµ¿Í È¿À²¼º¸é¿¡¼­ ÃÖÀûÈ­°¡ ¾ÈµÇÀÖ°í, ¼³°èÇÑ ¸ñÀûÀÌ¿ÜÀÇ ¹æ¹ýÀ¸·Î »ç¿ëÇÏ¸é º¸¾È»ó ¹®Á¦°¡ µÉ ¼ö ÀÖ´Ù.

top

ScriptLogBuffer Áö½Ã¾î

¼³¸í:½ºÅ©¸³Æ® ·Î±×¿¡ ±â·ÏÇÒ PUT ȤÀº POST ¿äûÀÇ ÃÖ´ë·®
¹®¹ý:ScriptLogBuffer bytes
±âº»°ª:ScriptLogBuffer 1024
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®
»óÅÂ:Base
¸ðµâ:mod_cgi, mod_cgid

Å« ³»¿ëÀ» ¹Þ¾Æ¼­ ·Î±×ÆÄÀÏÀÌ ³Ê¹« »¡¸® Ä¿Áö´Â Çö»óÀ» ¸·±âÀ§ÇØ ÆÄÀÏ¿¡ ±â·ÏÇÒ PUT ȤÀº POST ³»¿ëÀÇ Å©±â¸¦ Á¦ÇÑÇÑ´Ù. ±âº»ÀûÀ¸·Î 1024 ¹ÙÀÌÆ®±îÁö ·Î±×¿¡ ±â·ÏÇÏÁö¸¸, ÀÌ Áö½Ã¾î¸¦ »ç¿ëÇÏ¿© ¼öÁ¤ÇÒ ¼ö ÀÖ´Ù.

top

ScriptLogLength Áö½Ã¾î

¼³¸í:CGI ½ºÅ©¸³Æ® ·Î±×ÆÄÀÏÀÇ Å©±â Á¦ÇÑ
¹®¹ý:ScriptLogLength bytes
±âº»°ª:ScriptLogLength 10385760
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®
»óÅÂ:Base
¸ðµâ:mod_cgi, mod_cgid

ScriptLogLength´Â CGI ½ºÅ©¸³Æ® ·Î±×ÆÄÀÏÀÇ Å©±â¸¦ Á¦ÇÑÇÑ´Ù. CGI ¿À·ù°¡ ¹ß»ýÇÒ¶§¸¶´Ù (¸ðµç ¿äû Çì´õ, ¸ðµç ½ºÅ©¸³Æ® Ãâ·Â µî) ¸¹Àº Á¤º¸°¡ ·Î±×¿¡ ±â·ÏµÇ±â¶§¹®¿¡ ÆÄÀÏÀÌ ¸Å¿ì Ä¿Áú ¼ö ÀÖ´Ù. ÆÄÀÏÀÌ ¹«ÇÑÈ÷ Ä¿Áö´Â ¹®Á¦¸¦ ¸·±âÀ§ÇØ ÀÌ Áö½Ã¾î¸¦ »ç¿ëÇÏ¿© CGI ·Î±×ÆÄÀÏÀÇ ÃÖ´ë ÆÄÀÏÅ©±â¸¦ ¼³Á¤ÇÑ´Ù. ÆÄÀÏÀÇ Å©±â°¡ ¼³Á¤ÇÑ °ªÀ» ³ÑÀ¸¸é ´õ ÀÌ»ó Á¤º¸¸¦ ±â·ÏÇÏÁö¾Ê´Â´Ù.

°¡´ÉÇÑ ¾ð¾î:  en  |  ja  |  ko 

top

Comments

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.