Apache HTTP Server Version 2.2
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.
°¡»óÈ£½ºÆ®¸¦ ¸¹ÀÌ »ç¿ëÇÏ°í °¢ °¡»óÈ£½ºÆ®¿¡ ¼·Î ´Ù¸¥ ·Î±×ÆÄÀÏÀ» ÁöÁ¤Çϸé, ¾ÆÆÄÄ¡°¡ »ç¿ë°¡´ÉÇÑ ÆÄÀϱâ¼úÀÚ(file descriptor, ÈçÈ÷ ÆÄÀÏÇÚµé(file handle)À̶ó°í ºÎ¸§)¸¦ ´Ù ½á¹ö¸± ¼ö ÀÖ´Ù. ¾ÆÆÄÄ¡°¡ »ç¿ëÇÏ´Â ÆÄÀϱâ¼úÀÚÀÇ ÃÑ °³¼ö´Â ¿À·ù ·Î±×ÆÄÀÏ´ç ÇÑ°³, ´Ù¸¥ ·Î±×ÆÄÀÏ Áö½Ã¾î´ç ÇÑ°³, Ãß°¡·Î ³»ºÎ¿ëµµ·Î 10-20°³¸¦ ´õÇÑ ¼ö´Ù. À¯´Ð½º ¿î¿µÃ¼Á¦´Â ÇÁ·Î¼¼½º°¡ »ç¿ëÇÒ ¼ö ÀÖ´Â ÆÄÀϱâ¼úÀÚ °³¼ö¸¦ Á¦ÇÑÇÑ´Ù. ÀÌ ÇÑ°è´Â º¸Åë 64°³·Î, º¸Åë À̺¸´Ù Å« hard-limit±îÁö ´Ã¸± ¼ö ÀÖ´Ù.
¾ÆÆÄÄ¡´Â ÀÌ ÇѰ踦 ÇÊ¿äÇѸ¸Å ´Ã¸®·Á°í ÇÏÁö¸¸, ½ÇÆÐÇÏ´Â °æ¿ì°¡ ÀÖ´Ù:
setrlimit()
½Ã½ºÅÛÈ£ÃâÀ»
Á¦°øÇÏÁö ¾Ê´Â´Ù.setrlimit(RLIMIT_NOFILE)
ÇÔ¼ö°¡ µ¿ÀÛÇÏÁö
¾Ê´Â´Ù.ÀÌ °æ¿ì ÇØ°áÃ¥Àº:
<VirtualHost>
¼½¼Ç¿¡¼ ·Î±×ÆÄÀÏÀ»
ÁöÁ¤ÇÏÁö ¾Ê°í ÁÖ ·Î±×ÆÄÀÏÀ» »ç¿ëÇÑ´Ù. (´õ ÀÚ¼¼ÇÑ ¹æ¹ýÀº
¾Æ·¡ ·Î±×ÆÄÀÏ ³ª´©±â¸¦ Âü°íÇ϶ó.)
#!/bin/sh
ulimit -S -n 100
exec httpd
¿©·¯ °¡»óÈ£½ºÆ®°¡ °°Àº ·Î±×ÆÄÀÏÀ» »ç¿ëÇÑ´Ù¸é ³ªÁß¿¡ °¢ °¡»óÈ£½ºÆ®ÀÇ Åë°èºÐ¼®À» À§ÇØ ·Î±×ÆÄÀÏÀ» ³ª´©°í ½ÍÀ» °ÍÀÌ´Ù. ÀÌ ÀÛ¾÷Àº ´ÙÀ½°ú °°ÀÌ ÇÒ ¼ö ÀÖ´Ù.
¸ÕÀú ·Î±× Ç׸ñ¿¡ °¡»óÈ£½ºÆ® Á¤º¸¸¦ Ãß°¡ÇÑ´Ù. À̸¦ À§ÇØ
LogFormat
Áö½Ã¾î¿Í %v
º¯¼ö¸¦ »ç¿ëÇÑ´Ù. ÀÌ º¯¼ö¸¦ ·Î±×
Çü½Ä¹®ÀÚ¿ ¾Õ¿¡ Ãß°¡ÇÑ´Ù:
LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost
CustomLog logs/multiple_vhost_log vhost
±×·¯¸é common ·Î±×Çü½Ä ¾Õ¿¡ (ServerName
Áö½Ã¾î¿¡ ³ª¿À´Â) Á¤±Ô
°¡»óÈ£½ºÆ®¸¦ Æ÷ÇÔÇÏ¿© ·Î±×ÆÄÀÏÀ» ±â·ÏÇÑ´Ù. (·Î±×ÆÄÀÏ
»ç¿ëÀÚÁ¤ÀÇ¿¡ °üÇÑ ³»¿ëÀº »ç¿ëÀÚÁ¤ÀÇ ·Î±×Çü½Ä
À»
Âü°íÇ϶ó.)
·Î±×ÆÄÀÏÀ» (°¡»óÈ£½ºÆ®´ç ÇÑ ÆÄÀϾ¿) ³ª´©°í ½Í´Ù¸é split-logfile
ÇÁ·Î±×·¥À»
»ç¿ëÇÑ´Ù. ÀÌ ÇÁ·Î±×·¥Àº ¾ÆÆÄÄ¡ ¹èÆ÷º»ÀÇ support
µð·ºÅ丮¿¡ ÀÖ´Ù.
´ÙÀ½°ú °°ÀÌ ÇÁ·Î±×·¥À» ½ÇÇàÇÑ´Ù:
split-logfile < /logs/multiple_vhost_log
°¡»óÈ£½ºÆ® ·Î±×ÆÄÀÏÀ» °¡Áö°í ÀÌ ÇÁ·Î±×·¥À» ½ÇÇàÇÏ¸é ·Î±×ÆÄÀÏ¿¡
³ª¿À´Â °¢ °¡»óÈ£½ºÆ®´ç ÆÄÀÏÀ» Çϳª¾¿ ¸¸µç´Ù. °¢°¢ÀÇ ÆÄÀϸíÀº
hostname.log
ÀÌ´Ù.