ãã㯠mod_mruby ngx_mruby Advent Calendar 2014 ã®ï¼ï¼æ¥ç®(12/18)ã®æ稿ã§ãã ãã®æ稿ã®ä½ç½®ã¥ãã¨ãã¦ã¯ãã¢ããã³ãã«ã¬ã³ãã¼ã®ï¼ï¼æ¥ç®ã«æ¸ããè¨äºï¼éçãªã½ã¼ã¹ããªãã¼ã¹ãããã·ã§é ä¿¡ããï¼ã®å¿ç¨ç·¨ã§ãã Apache ã§ã¯ããªãã¼ã¹ãããã·ããã³ã³ãã³ãã«å¯¾ãã¦ãæ´ã«åºåãã£ã«ã¿ãããã¦å¦çãããã¨ãåºæ¥ã¾ããï¼æåãªåºåãã£ã«ã¿ã 㨠mod_deflate ãªã©ãï¼ ã¤ã¡ã¼ã¸ã¯æ¬¡ã®ã¨ããã Apache ã®ãã£ã«ã¿ã«ã¤ãã¦ã®èª¬æã¯ãã¡ããã¡ãªã¿ã«ã³ã³ãã³ããã³ãã©(ä¾ï¼PHPãPerl)ã®åã«èµ·åãããã®ãå ¥åãã£ã«ã¿ã§ãå¾ã«èµ·åãããã®ãåºåãã£ã«ã¿ã§ãã â http://httpd.apache.org/docs/current/ja/filter.html ãã¡ãã mod_mruby ã§ããã£ã«ã¿ãä½æã§ãã¾ãã®ã§ãåæ§ã«ãª
# workerããã»ã¹åæåæ # ngx_mrubyã ã¨mruby_init_workerãã£ã¬ã¯ãã£ã mrubyChildInitMiddle /etc/apache2/hooks/geo_init.rb <Location /> # ãªã¯ã¨ã¹ãæ¯ã«ã¢ã¯ã»ã¹ãã§ã㯠# ngx_mrubyã ã¨mruby_access_handlerãã£ã¬ã¯ãã£ã mrubyAccessCheckerMiddle /etc/apache2/hooks/geo_check.rb </Location> # pidããã¼ã«ã¦ã¼ã¶ãã¼ã¿ã«ãªãã¸ã§ã¯ããä¿å Userdata.new("geoip_#{Process.pid}").geoip = GeoIP.new("/usr/share/GeoIP/GeoIPCity.dat") # mod_mrubyã ã¨Apacheã¯ã©ã¹ãngx_mrubyã ã¨Ngi
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}