À¥È£½ºÆÃ ¼¹ö ¾ÆÆÄÄ¡ Æ®·¡ÇÈ Á¦ÇѰɱâ
¾ÆÆÄÄ¡ Æ®·¡ÇÈ Á¦ÇÑ.
1. À¥È£½ºÆÃ ¾ÆÆÄÄ¡ Æ®·¡ÇÈ Á¦ÇÑ.
*¸ÕÀú http://www.snert.com/Software/mod_throttle/mod_throttle312.tgz
mod_throttle312.tgz ´Ù¿î¹Þ´Â´Ù.
#tar xvfpz mod_throttle312.tgz(¾ÐÃàǬ´Ù)
#cd /usr/local/src/mod_throttle-3.1.2
#make install ½ÃŲ´Ù.
apxs -i -a -n 'throttle' mod_throttle.so
make: apxs: Command not found
make: *** [install] Error 127
(Âü°í ÀνºÅç½Ã ¿¡·¯°¡ ¹ß»ýÇÑ´Ù. ±×¸®°í APM¼¼ÆÃ ¹æ½ÄÀ» DSO¹æ½ÄÀ¸·Î ¼³Ä¡ÇÑ´Ù.
STATIC¹æ½ÄÀ¸·Î ¼³Ä¡Çصµ µÇÁö¸¸, ±× ºÎºÐÀº ´Ù½Ã ¼³Á¤ÇؾßÇÑ´Ù.)
* static¹æ½ÄÀ¸·Î ¼³Ä¡ ÇßÀ» °æ¿ì ...
configure ½Ã--add-module=$mod_throttle_source_PATH/mod_throttle.c Ãß°¡.
* ±×·³ DSO¹æ½ÄÀ¸·Î ¼³Ä¡ ÇßÀ» °æ¿ì...
* ¸ðµâÀ» ¸¸µé¾îÁØ´Ù.
[root@abcd mod_throttle-3.1.2]# /usr/local/apache/bin/apxs -c mod_throttle.c(¸ðµâÀ» ¸¸µé¾îÁØ´Ù)
gcc -DLINUX=22 -DUSE_HSREGEX -fpic -DSHARED_CORE -DSHARED_MODULE
-I/usr/local/apache/include -c mod_throttle.c
gcc -shared -o mod_throttle.so mod_throttle.o
* ¿¡·¯ºÎºÐ¿¡ Ãß°¡ ÇØÁÖ¸é µÈ´Ù.
[root@abcd mod_throttle-3.1.2]# /usr/local/apache/bin/apxs -i -a -n 'throttle' mod_throttle.so
[activating module `throttle' in /usr/local/apache/conf/httpd.conf]
cp mod_throttle.so /usr/local/apache/libexec/mod_throttle.so
chmod 755 /usr/local/apache/libexec/mod_throttle.so
cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak
cp /usr/local/apache/conf/httpd.conf.new /usr/local/apache/conf/httpd.conf
rm /usr/local/apache/conf/httpd.conf.new
* À̺κбîÁö ¼³Ä¡ °úÁ¤ ³¡ ±×·³ httpd.conf ÆÄÀÏ ¼³Á¤.
%°øÅë ¼³Á¤ ºÎºÐ
Order deny,allow
Denny from all
Allow from 211.174....
¾Õ¿¡¼ ó·³ ¼³Á¤ÇßÀ¸¸é http://mydomain/throttle-status/·Î Á¢¼Ó½Ã
¸ðµç µµ¸ÞÀο¡ ´ëÇÑ Æ®·¡ÇÈÀ̳ª Á¢¼ÓÀÚ¼ö µîÀÇ Áß¿äÇÑ Á¤º¸°¡ ³ëÃâµÈ´Ù. ±×·¡¼.
ƯÁ¤ IP´ë¿ª¿¡¼¸¸ (211.174..)Á¢±ÙÀÌ °¡´ÉÇϵµ·Ï Á¦ÇÑÇÑ´Â ¼³Á¤.
%Àüü ÀûÀ¸·Î Æ®·¡ÇÈÀ» Á¶Á¤½Ã ÀϹݼ³Á¤.
ThrottlePolicy Volume 300M 1d // 1ÀÏ 300 M ·Î Á¦ÇÑ
SetHandler throttle-status
SetHandler throttle-me
Order deny,allow
Deny from all
Allow from all
SetHandler throttle-me
À§ÀÇ ¼³Á¤Àº ÀüüÀûÀ¸·Î Æ®·¡ÇÈÀ» Á¦ÇÑÇѰÍÀÌ´Ù.
±×·¯³ª ½ÇÁúÀûÀ¸·Î´Â throttlePolicy noneÀ¸·Î ¼³Á¤ÇØÁִ°ÍÀÌ ´ëºÐÀÌ´Ù.
throttle-me´Â http://atpple.com/throttle-me/Á¢¼Ó½Ã atpple.comÀ̶ó´Â
ÇϳªÀÇ µµ¸ÞÀο¡ ´ëÇØ¼¸¸ Á¤º¸¸¦ È®ÀÌ ÇÒ ¼ö ÀÖ´õ·Î ÇÏ´Â ¹æº¡ÀÔ´Ï´Ù.
%°¡»óÈ£½ºÆ®
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /www/docs/dummy-host.example.com
ServerName dummy-host.example.com
ServerAlias example.com www.example.com
Throttle Policy Volume 100M 1d //1ÀÏ 100M Á¦ÇÑ
Throttle Policy Request 1000 1d //1ÀÏ È÷Æ®¼ö 1000ȸ Á¦ÇÑ
Throttle ClientIP 100 volume 200 300 //·Î±×¸¦ 100K³²±â¸ç 300Ãʰ£ 200K ÀÇ Àü¼Û·®Á¦ÇÑ
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
À§¿Í °°ÀÌ ¼³Á¤ ÈÄ Á¤¼Û·®À̳ª È÷Æ®¼öµîÀ» ÃʰúÇϸé example.comÁ¢¼Ó½Ã ¿ø·¡ÀÇ ÆäÀÌÁö
¾Æ´Ï 503¿¡·¯ ȸéÀÌ¶ß°Ô µÈ´Ù. ErrorDoucumet503 /¿¡·¯¸Þ¼¼Áö °æ·Î ȤÀº ÁÖ¼Ò·Î redirect
¼³Á¤À» Ãß°¡ÇØ ÁÖ¸é Æ®·¡ÇÈ Ãʰú½Ã 503¿¡·¯ È¸é ´ë½Å ¸®´ÙÀÌ·ºÆ®ÇÏ¿© ÁöÁ¤ÇìÁØ ¿¡·¯È¸éÀ»
º¸¿©ÁØ´Ù.
±×·¡¼ ÀÌ ¿¡·¯È¸é¿¡ °æ°í¹®ÀÌÇÏ´Ï Ãß°í È÷Æ®¹× Æ®·¡ÇÈ¿¡ ´ëÇØ °æ°í¹®À» ¸¸µç´Ù.
% ÀÏ¹Ý ¼³Á¤ ºÎºÐ
ThrottlePolicy Volume 300M 1d
SetHandler throttle-status
% °¡»óÈ£½ºÆ® ¼³Á¤ºÎºÐ.
ServerAdmin webmaster@example.com
DocumentRoot /home/atpple/public_html
ServerName example.com
ThrottlePolicy Volume 500M 1d // ÇÏ·ç¿¡ Àü¼Û·® 500M
À§¿Í °°ÀÌ ¼³Á¤½Ã º°µµ·Î Á¦ÇÑÀ» ¼³Á¤ÇÏÁö ¾ÊÀº ¸ðµç µµ¸ÞÀÎÀº ÇÏ·ç Á¤¼Û·®ÀÌ 1ÀÏ 300¸Þ°¡·Î
Á¦ÇÑ µÇÁö¸¸. example.comÀº 500M·Î Á¦ÇѵȴÙ.
±×·¯³ª À§¿Í °°ÀÌ ¼³Á¤ÇÒ °æ¿ì Á¦´ë·Î µ¿ÀÛÇÏÁö ¾ÊÀº °æ¿ì°¡ ÀÖÀ¸¹Ç·Î ƯÁ¤ µµ¸ÞÀο¡ ´ëÇØ¼
°¡»óÈ£½ºÆ® ¼³Á¤½Ã ¼±ÅÃÀûÀ¸·Î Àû¿ëÇϴ°ÍÀÌ ÁÁ´Ù.
¸ðµç ¼³Á¤¿¡ ´ëÇÑ °ü¸®´Â http://mydomain/throttle-status¿¡¼ °¡´ÉÇÏ¸ç °¢ °³Àκ° µµ¸ÞÀο¡
´ëÇÑ Æ®·¡ÇÈ »ç¿ë ¾çÀ̳ª È÷Æ®¼ö µîÀº http://mydomain/throttle-me¿¡¼ º¼ ¼ö ÀÖ´Ù.
ƯÈ÷ throttle-statusÀÇ °æ¿ì ÇöÀç »ç¿ëÇÑ Æ®·¹ÇÈ ¾çÀ» ÃʱâÈ ½Ãų ¼öµµ ÀÖÀ¸¹Ç·Î ²À Ư
Á¤ IP¿¡ ´ëÇÑ ´ë¿ªÀ» ¼³Á¤ÇØÁֱ⠹ٶø´Ï´Ù.
|