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

»ç¿ëÀÚÁ¤ÀÇ ¿À·ù ÀÀ´ä

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

ÀÌ ¹®¼­´Â ÃÖ½ÅÆÇ ¹ø¿ªÀÌ ¾Æ´Õ´Ï´Ù. ÃÖ±Ù¿¡ º¯°æµÈ ³»¿ëÀº ¿µ¾î ¹®¼­¸¦ Âü°íÇϼ¼¿ä.

À¥¸¶½ºÅÍ´Â ¿À·ù³ª ¹®Á¦°¡ ¹ß»ýÇßÀ»¶§ ¾ÆÆÄÄ¡ÀÇ ÀÀ´äÀ» ¼³Á¤ÇÒ ¼ö ÀÖ´Ù.

¼­¹ö°¡ ¿À·ù³ª ¹®Á¦¸¦ ¹ß°ßÇßÀ»¶§ º¸³¾ »ç¿ëÀÚÁ¤ÀÇ ÀÀ´äÀ» Á¤ÀÇÇÒ ¼ö ÀÖ´Ù.

½ºÅ©¸³Æ®°¡ Á×Àº °æ¿ì "500 Server Error" ÀÀ´ä ´ë½Å »ç¿ëÀÚ¿¡°Ô ´õ Ä£±ÙÇÑ ¹®±¸¸¦ »ç¿ëÇϰųª ´Ù¸¥ (°°Àº »çÀÌÆ®³ª ¿ÜºÎ »çÀÌÆ®ÀÇ) URL·Î ¸®´ÙÀÌ·º¼ÇÀ» ÇÒ ¼ö ÀÖ´Ù.

top

Çൿ

ÀÌÀü Çൿ

NCSA httpd 1.3Àº »ç¿ëÀÚ¿¡°Ô ¹«ÀǹÌÇÏ°í Áö·çÇÑ ¿À·ù¹®À» º¸³Â´Ù. ¹®Á¦°¡ ¹ß»ýÇÑ ÀÌÀ¯¸¦ ·Î±×¿¡ ³²±æ ¼öµµ ¾ø¾ú´Ù.

»õ·Î¿î Çൿ

¼­¹ö´Â ´ÙÀ½°ú °°Àº ÀÏÀ» ÇÒ ¼ö ÀÖ´Ù:

  1. NCSAÀÇ °íÁ¤µÈ ¹®±¸ ´ë½Å ´Ù¸¥ ¹®±¸¸¦ º¸¿©Áְųª
  2. °°Àº »çÀÌÆ®ÀÇ URL·Î ¸®´ÙÀÌ·º¼ÇÇϰųª
  3. ¿ÜºÎ »çÀÌÆ®ÀÇ URL·Î ¸®´ÙÀÌ·º¼ÇÇÑ´Ù.

´Ù¸¥ »çÀÌÆ®ÀÇ URL·Î ¸®´ÙÀÌ·º¼ÇÇÏ´Â °ÍÀÌ À¯¿ëÇÒ ¼ö ÀÖÁö¸¸, ÀÌ °æ¿ì ¹®Á¦¸¦ ¼³¸íÇϰųª ·Î±×Çϴµ¥ ÇÊ¿äÇÑ Á¤º¸Áß ÀϺθ¸ Àü´ÞµÈ´Ù.

¿À·ù¿¡ ´ëÇÑ Á¤º¸¸¦ Àü´ÞÇϱâÀ§ÇØ ¾ÆÆÄÄ¡´Â CGI½ÄÀÇ »õ·Î¿î ȯ°æº¯¼ö¸¦ Á¤ÀÇÇÑ´Ù:

REDIRECT_HTTP_ACCEPT=*/*, image/gif, image/x-xbitmap, image/jpeg
REDIRECT_HTTP_USER_AGENT=Mozilla/1.1b2 (X11; I; HP-UX A.09.05 9000/712)
REDIRECT_PATH=.:/bin:/usr/local/bin:/etc
REDIRECT_QUERY_STRING=
REDIRECT_REMOTE_ADDR=121.345.78.123
REDIRECT_REMOTE_HOST=ooh.ahhh.com
REDIRECT_SERVER_NAME=crash.bang.edu
REDIRECT_SERVER_PORT=80
REDIRECT_SERVER_SOFTWARE=Apache/0.8.15
REDIRECT_URL=/cgi-bin/buggy.pl

REDIRECT_ Á¢µÎ»ç¿¡ ÁÖ¸ñÇ϶ó.

ÃÖ¼ÒÇÑ REDIRECT_URL°ú REDIRECT_QUERY_STRINGÀº (cgi-script³ª cgi-includeÀÏ) »õ URL·Î ³Ñ°ÜÁø´Ù. ´Ù¸¥ º¯¼ö´Â ¿À·ù°¡ ¹ß»ýÇϱâ ÀÌÀü¿¡ (¿ªÁÖ; À̸§¿¡¼­ REDIRECT_¸¦ »« ȯ°æº¯¼ö°¡) Á¸ÀçÇÑ °æ¿ì¿¡¸¸ ÀÖ´Ù. ErrorDocument°¡ ¿ÜºÎ·Î (°°Àº ¼­¹ö¶óµµ http:¿Í °°Àº ½ºÅ´(scheme)À¸·Î ½ÃÀÛÇÑ´Ù¸é) ¸®´ÙÀÌ·º¼ÇÇÑ´Ù¸é ÀÌÁß ¾î¶² °Íµµ ¼³Á¤µÇÁö ¾Ê´Â´Ù.

top

¼³Á¤

AllowOverride°¡ ÀûÀýÈ÷ ¼³Á¤µÇ¾ú´Ù¸é .htaccess ÆÄÀÏ¿¡¼­ ErrorDocument¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù.

´ÙÀ½Àº ¿¹ÀÌ´Ù...

ErrorDocument 500 /cgi-bin/crash-recover
ErrorDocument 500 "Sorry, our script crashed. Oh dear"
ErrorDocument 500 http://xxx/
ErrorDocument 404 /Lame_excuses/not_found.html
ErrorDocument 401 /Subscription/how_to_subscribe.html

¹®¹ýÀº,

ErrorDocument <3-digit-code> <action>

°¡´ÉÇÑ actionÀº,

  1. Ãâ·ÂÇÒ ¹®±¸. µû¿ÈÇ¥ (")¸¦ ¹®±¸ ¾Õ¿¡ ºÙÀδÙ. µÚ¿¡ ³ª¿À´Â µû¿ÈÇ¥´Â Ãâ·ÂµÈ´Ù. ÁÖÀÇ: ¾Õ¿¡ ºÙÀº µû¿ÈÇ¥ (")´Â Ãâ·ÂµÇÁö ¾Ê´Â´Ù.
  2. ¸®´ÙÀÌ·º¼ÇÇÒ ¿ÜºÎ URL.
  3. ¸®´ÙÀÌ·º¼ÇÇÒ ³»ºÎ URL.
top

»ç¿ëÀÚÁ¤ÀÇ ¿À·ù ÀÀ´ä°ú ¸®´ÙÀÌ·º¼Ç

URL·Î ¸®´ÙÀÌ·º¼ÇÇÏ´Â ¾ÆÆÄÄ¡ ÇൿÀº ½ºÅ©¸³Æ®/server-include¿¡ ȯ°æº¯¼ö¸¦ ´õ ³Ñ°ÜÁÖµµ·Ï º¯°æµÇ¾ú´Ù.

ÀÌÀü Çൿ

¸®´ÙÀÌ·º¼ÇµÇ´Â ½ºÅ©¸³Æ®¿¡ Ç¥ÁØ CGI º¯¼öµéÀÌ ³Ñ¾î°£´Ù. ¾îµð¿¡¼­ ¸®´ÙÀÌ·º¼ÇÀÌ ÀϾ´ÂÁö ¾Ë ¼ö ¾ø´Ù.

»õ·Î¿î Çൿ

¸®´ÙÀÌ·º¼ÇµÈ ½ºÅ©¸³Æ®´Â »õ·Î¿î ȯ°æº¯¼öµéÀ» »ç¿ëÇÒ ¼ö ÀÖ´Ù. ¸ðµÎ ¾Õ¿¡ REDIRECT_°¡ ºÙ¾îÀÖ´Ù. REDIRECT_ ȯ°æº¯¼ö´Â ¿ø·¡ CGI ȯ°æº¯¼ö¸í ¾Õ¿¡ REDIRECT_¸¦ ºÙ¿©¼­ ¸¸µç´Ù. ¿¹¸¦ µé¾î, HTTP_USER_AGENT´Â REDIRECT_HTTP_USER_AGENT°¡ µÇ¾ú´Ù. ÀÌ·± º¯¼ö¿¡ Ãß°¡·Î ½ºÅ©¸³Æ®°¡ ¿ø·¡ URLÀ» ¾Ëµµ·Ï ¾ÆÆÄÄ¡´Â REDIRECT_URL°ú REDIRECT_STATUS¸¦ Á¤ÀÇÇÑ´Ù. ¿ø·¡ URL°ú ¸®´ÙÀÌ·º¼ÇµÈ URL ¸ðµÎ Á¢±Ù ·Î±×¿¡ ±â·ÏÇÒ ¼ö ÀÖ´Ù.

ErrorDocument°¡ °°Àº ¼­¹ö¿¡ ÀÖ´Â CGI ½ºÅ©¸³Æ®·Î ¸®´ÙÀÌ·º¼ÇÇÑ´Ù¸é, ½ºÅ©¸³Æ®´Â Ŭ¶óÀ̾ðÆ®¿¡°Ô ¿À·ù »óȲÀ» È®½ÇÈ÷ Àü´ÞÇϱâÀ§ÇØ Ãâ·Â¿¡ "Status:" Çì´õ Çʵ带 Æ÷ÇÔÇØ¾ß ÇÑ´Ù. ¿¹¸¦ µé¾î, Perl·Î ÀÛ¼ºÇÑ ErrorDocument ½ºÅ©¸³Æ®´Â ´ÙÀ½°ú °°´Ù:

...
print "Content-type: text/html\n";
printf "Status: %s Condition Intercepted\n", $ENV{"REDIRECT_STATUS"};
...

404 Not Found¿Í °°Àº ƯÁ¤ ¿À·ù »óȲ¿¡ ´ëÇÑ ½ºÅ©¸³Æ®¶ó¸é, ´ë½Å (¿ªÁÖ; °íÁ¤µÈ) ƯÁ¤ »óÅÂÄÚµå¿Í ¿À·ù¹®À» »ç¿ëÇÒ ¼ö ÀÖ´Ù.

(Ŭ¶óÀ̾ðÆ®¿¡°Ô ¸®´ÙÀÌ·º¼ÇÀ» ¿äûÇϱâÀ§ÇØ) ÀÀ´ä¿¡ Location: Çì´õ¸¦ Æ÷ÇÔÇÑ´Ù¸é, ½ºÅ©¸³Æ®´Â ¹Ýµå½Ã (302 Found °°Àº) ÀûÀýÇÑ Status: Çì´õ¸¦ Ãâ·ÂÇØ¾ß ÇÔÀ» ÁÖÀÇÇ϶ó. ±×·¸Áö¾ÊÀ¸¸é Location: Çì´õ°¡ ¾Æ¹« ¼Ò¿ë¾ø°Ô µÉ ¼ö ÀÖ´Ù.

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

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.