{"id":2884,"date":"2015-03-18T00:03:05","date_gmt":"2015-03-17T15:03:05","guid":{"rendered":"http:\/\/www.frontier-line.org\/lognote\/?p=2884"},"modified":"2015-03-18T00:03:05","modified_gmt":"2015-03-17T15:03:05","slug":"apache2-4-mod_evasive","status":"publish","type":"post","link":"http:\/\/www.frontier-line.org\/lognote\/?p=2884","title":{"rendered":"Apache2.4 + mod_evasive"},"content":{"rendered":"<p>\u5148\u9031\u672b\u304f\u3089\u3044\u304b\u3089\u3057\u3070\u3057\u3070\u3053\u306e\u30b5\u30fc\u30d0\u304c\u6b62\u307e\u308a\u307e\u3057\u3066\u3001swap_pager\u3067\u30a8\u30e9\u30fc\u767a\u751f\u3067\u3001\u5f37\u5236\u30ea\u30d6\u30fc\u30c8\u4ee5\u5916\u306b\u52d5\u304b\u3059\u624b\u6bb5\u304c\u7121\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>apache\u306e\u30ed\u30b0\u3092\u898b\u3066\u307f\u308b\u3068\u3001WordPress\u306e\u30ed\u30b0\u30a4\u30f3\u306b\u9023\u7d9a\u3057\u3066\u95a2\u4fc2\u7121\u3044\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u9023\u7d9a\u30a2\u30af\u30bb\u30b9\u304c\u3042\u3063\u305f\u308a\u3057\u3066\u3001\u307e\u3042\u3088\u304f\u3042\u308b\u3053\u3068\u3060\u3051\u3069\u653b\u6483\u3055\u308c\u3066\u308b\u306a\u3068\u3002\u56e0\u679c\u95a2\u4fc2\u304c\u306f\u3063\u304d\u308a\u3057\u306a\u3044\u306e\u3060\u3051\u3069\u3001\u96c6\u4e2d\u7684\u306a\u653b\u6483\u306e\u5f8c\u3001FreeBSD\u304cswap\u78ba\u4fdd\u306b\u5931\u6557\u3059\u308b\u3068\u3044\u3046\u3053\u3068\u3082\u3042\u308b\u3088\u3046\u306a\u306e\u3067\u3001DoS\u653b\u6483\u5bfe\u7b56\u3092\u3057\u3066\u69d8\u5b50\u3092\u898b\u3088\u3046\u3068\u601d\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>Apache\u306eDos\u5bfe\u7b56\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u3044\u3046\u3068\u3001mod_evasive\u304c\u6709\u540d\u3067\u3059\u3002\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u8a18\u9332\u3082\u3044\u308d\u3093\u306a\u30b5\u30a4\u30c8\u3055\u3093\u306b\u3042\u308b\u306e\u3060\u3051\u3069\u3001\u5b9f\u306f\u7f60\u304c\u3002Apache2.2\u307e\u3067\u306f\u691c\u7d22\u3057\u3066\u51fa\u3066\u304f\u308b\u30b5\u30a4\u30c8\u3055\u3093\u306e\u3084\u308a\u65b9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u30012.4\u3067\u540c\u3058\u3088\u3046\u306b\u3059\u308b\u3068\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4e0d\u53ef\u80fd\u3067\u3059\u30022.X\u3067\u4f7f\u3048\u308b\u3001\u3068\u66f8\u3044\u3066\u3042\u308b\u306e\u3067\u3064\u3044\u4fe1\u7528\u3057\u3066\u75db\u3044\u76ee\u3092\u898b\u307e\u3057\u305f\u3002\u3069\u3046\u3082\u30012.4\u304b\u3089Apache\u306eAPI\u5909\u66f4\u304c\u3042\u3063\u305f\u306e\u304c\u304d\u3044\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002\u52d5\u304b\u3059\u306b\u306f\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u4f55\u884c\u304b\u5909\u66f4\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u306e\u3067\u3059\u3002\u305d\u308c\u3067\u3001\u63a2\u3057\u56de\u3063\u3066\u3001\u4fee\u6b63\u6e08\u307f\u306e\u3082\u306e\u304c<a href=\"http:\/\/sites.extremehosting.ca\/mod_evasive24\/\" target=\"_blank\">http:\/\/sites.extremehosting.ca\/mod_evasive24\/<\/a>\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u306e\u3092\u898b\u3064\u3051\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304d\u3066\u3001\/usr\/local\/src\u306b\u5165\u308c\u307e\u3059\u3002<br \/>\ntar zxvf mod_evasive_1.10.1_apache_2.4.tar.gz<br \/>\n\u3067\u3001mod_evasive\u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u5c55\u958b\u3055\u308c\u307e\u3059\u3002mod_evasive24.c\u304c\u3001mod_evasive20.c\u3092\u7f6e\u304d\u63db\u3048\u305f\u3082\u306e\u306b\u306a\u308a\u307e\u3059\u3002\u5909\u306a\u30b3\u30fc\u30c9\u304c\u4ed5\u7d44\u307e\u308c\u3066\u306a\u3044\u304b\u3001\u30aa\u30ea\u30b8\u30ca\u30eb\u306e\u3082\u306e\u3068diff\u3067\u78ba\u8a8d\u3057\u307e\u3057\u305f\u304c\u5927\u4e08\u592b\u306e\u3088\u3046\u3067\u3059\u3002<br \/>\n\u30a6\u30c1\u3067\u306f\u3001apache\u306f\u3001\/usr\/local\/apache2\u306b\u5165\u308c\u3066\u3044\u308b\u306e\u3067\u3001<\/p>\n<blockquote><p>cd mod_evasive<br \/>\n\/usr\/local\/apache2\/bin\/apxs -i -a -c mod_evasive24.c\n<\/p><\/blockquote>\n<p>\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u307e\u3059\u3002\n<\/p>\n<p>\u4e00\u5fdc\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u306b\u306fapache\u306bmod_so.c\u304c\u5165\u3063\u3066\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u3001<\/p>\n<blockquote><p>\/usr\/local\/apache2\/bin\/apachectl -l<\/p><\/blockquote>\n<p>\u3067\u78ba\u8a8d\u3057\u3066\u304b\u3089\u4f5c\u696d\u3057\u307e\u3059\u3002\n<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u7d42\u308f\u308b\u3068\u3001httpd.conf\u306b\u3001<\/p>\n<blockquote><p>LoadModule evasive20_module   modules\/mod_evasive24.so<\/p><\/blockquote>\n<p>\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u52d5\u304b\u3059\u306b\u306f\u3001\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u51fa\u529b\u5148\u3092\u7528\u610f\u3057\u307e\u3059\u3002\u3069\u3053\u306b\u4f5c\u3063\u3066\u3082\u3044\u3044\u306e\u3067\u3001Apache\u306e\u30ed\u30b0\u306e\u3068\u3053\u308d\u306b\u5165\u308c\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<blockquote><p>mkdir \/usr\/local\/apache2\/logs\/mod_evasive\/<br \/>\nchown nobody:nobody \/usr\/local\/apache2\/logs\/mod_evasive\/\n<\/p><\/blockquote>\n<p>\u66f8\u304d\u8fbc\u3081\u308b\u3088\u3046\u306b\u30d5\u30a1\u30a4\u30eb\u6240\u6709\u8005\u3092\u5909\u3048\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>httpd.conf\u306b\u6b21\u306e\u5185\u5bb9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<blockquote><p>\n&lt;IfModule mod_evasive24.c&gt;<br \/>\nDOSHashTableSize 3097<br \/>\nDOSPageCount 3<br \/>\nDOSSiteCount 20<br \/>\nDOSPageInterval 2<br \/>\nDOSSiteInterval 1<br \/>\nDOSBlockingPeriod 3600<br \/>\n#\tDOSWhitelist 127.0.0.1\t\t\t\u30c6\u30b9\u30c8\u5f8c\u306b\u3053\u308c\u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3001\u30eb\u30fc\u30d7\u30d0\u30c3\u30af\u30a2\u30c9\u30ec\u30b9\u306f\u5168\u90e8\u8a31\u53ef\u306b\u3002<br \/>\nDOSLogDir &quot;\/usr\/local\/apache2\/logs\/mod_evasive&quot;<br \/>\n#    DOSEmailNotify xxxxx@xxxx.jp\u3000\u2190\u62d2\u5426\u3057\u305fIP\u30a2\u30c9\u30ec\u30b9\u3092\u30e1\u30fc\u30eb\u9001\u4ed8\u3002<br \/>\n&lt;\/IfModule&gt;\n<\/p><\/blockquote>\n<p>\u3053\u308c\u304c\u7d42\u308f\u3063\u305f\u3089\u3001.\/apachectl graceful \u3092\u5b9f\u884c\u3057\u3066\u8a2d\u5b9a\u3092\u53cd\u6620\u3055\u305b\u307e\u3059\u3002<\/p>\n<blockquote><p>.\/apachectl -M<\/p><\/blockquote>\n<p>\u3092\u5b9f\u884c\u3059\u308c\u3070\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u7d44\u307f\u8fbc\u307e\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u52d5\u4f5c\u78ba\u8a8d\u306f\u6dfb\u4ed8\u306ePerl\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u3063\u3066\u884c\u3044\u307e\u3059\u3002<\/p>\n<blockquote><p>cd \/usr\/local\/src\/mod_evasive<br \/>\nchmod +x test.pl<br \/>\n\/usr\/local\/src\/mod_evasive\/test.pl\n<\/p><\/blockquote>\n<p>\u3092\u5b9f\u884c\u3057\u3001\u9014\u4e2d\u307e\u3067\u306fOK\u3067\u3001\u9014\u4e2d\u304b\u3089Forbidden\u306b\u306a\u308c\u3070\u554f\u984c\u306a\u304f\u52d5\u4f5c\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u30c6\u30b9\u30c8\u304c\u68f2\u3093\u3060\u3089\u3001httpd.conf\u306e\u30eb\u30fc\u30d7\u30d0\u30c3\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u3068\u3053\u308d\u306e\u30b3\u30e1\u30f3\u30c8\u3092\u5916\u3057\u3001\u30eb\u30fc\u30d7\u30d0\u30c3\u30af\u306b\u3064\u3044\u3066\u306f\u5168\u3066\u4fe1\u983c\u3059\u308b\u3068\u3044\u3046\u8a2d\u5b9a\u306b\u5909\u66f4\u3057\u3001\u518d\u5ea6\u3001.\/apachectl graceful\u3000\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u3069\u3053\u304b\u3089\u306e\u30a2\u30c9\u30ec\u30b9\u3092\u62d2\u5426\u3057\u305f\u304b\u3092\u30e1\u30fc\u30eb\u3067\u53d7\u3051\u53d6\u308a\u305f\u3051\u308c\u3070\u3001\u30b3\u30e1\u30f3\u30c8\u3092\u5916\u3057\u3066\u9001\u308a\u5148\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u66f8\u304d\u8fbc\u3081\u3070\u3067\u304d\u308b\u3088\u3046\u3067\u3059\u3002\u3046\u308b\u3055\u305d\u3046\u306a\u306e\u3067\u3084\u3063\u3066\u307e\u305b\u3093\u304c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5148\u9031\u672b\u304f\u3089\u3044\u304b\u3089\u3057\u3070\u3057\u3070\u3053\u306e\u30b5\u30fc\u30d0\u304c\u6b62\u307e\u308a\u307e\u3057\u3066\u3001swap_pager\u3067\u30a8\u30e9\u30fc\u767a\u751f\u3067\u3001\u5f37\u5236\u30ea\u30d6\u30fc\u30c8\u4ee5\u5916\u306b\u52d5\u304b\u3059\u624b\u6bb5\u304c\u7121\u304f\u306a\u308a\u307e\u3059\u3002 apache\u306e\u30ed\u30b0\u3092\u898b\u3066\u307f\u308b\u3068\u3001WordPress\u306e\u30ed\u30b0\u30a4\u30f3\u306b\u9023\u7d9a\u3057\u3066\u95a2\u4fc2\u7121\u3044\u30a2\u30c9\u30ec\u30b9\u304b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2884","post","type-post","status-publish","format-standard","hentry","category-computers"],"_links":{"self":[{"href":"http:\/\/www.frontier-line.org\/lognote\/index.php?rest_route=\/wp\/v2\/posts\/2884","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.frontier-line.org\/lognote\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.frontier-line.org\/lognote\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.frontier-line.org\/lognote\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.frontier-line.org\/lognote\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2884"}],"version-history":[{"count":0,"href":"http:\/\/www.frontier-line.org\/lognote\/index.php?rest_route=\/wp\/v2\/posts\/2884\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.frontier-line.org\/lognote\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2884"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.frontier-line.org\/lognote\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2884"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.frontier-line.org\/lognote\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}