{"id":253,"date":"2018-11-23T10:40:37","date_gmt":"2018-11-23T02:40:37","guid":{"rendered":"http:\/\/www.tra56.com\/?p=253"},"modified":"2018-11-23T11:04:30","modified_gmt":"2018-11-23T03:04:30","slug":"253","status":"publish","type":"post","link":"https:\/\/www.tra56.com\/253.html","title":{"rendered":"Apache\u9650\u5236IP\u5e76\u53d1\u6570\u548c\u6d41\u91cf\u63a7\u5236\u7684\u65b9\u6cd5"},"content":{"rendered":"
\u672c\u6587\u7ae0\u6765\u7ed9\u5404\u4f4d\u540c\u5b66\u603b\u7ed3\u4e00\u4e0bAPACHE\u4e2d\u9650\u5236IP\u8fde\u63a5\u6570\u4e0eIP\u5e76\u53d1\u6570\u548c\u6d41\u91cf\u63a7\u5236\u5b9e\u73b0\u65b9\u6cd5\uff0c\u5982\u679c\u53ea\u9650\u5236\u8fde\u63a5\u6570\u636e\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528limit\uff0c\u5982\u679c\u8981\u9650\u5236\u5176\u5b83\u7684\u9700\u8981\u4f7f\u7528\u5176\u5b83\u7b2c\u4e09\u65b9\u6a21\u5757\u4e86<\/p>\n
\u4f7f\u7528mod_limitipconn\u6a21\u5757\u9650\u5236IP\u5e76\u53d1\u8fde\u63a5\u6570
\u5b89\u88c5\uff1a<\/p>\n
wget http:<\/code>\/\/dominia<\/code>.org<\/code>\/djao\/limit\/mod_limitipconn-0<\/code>.24.<\/code>tar<\/code>.bz2<\/code>
\n <\/div>\ntar<\/code> jxvf mod_limitipconn-0.24.<\/code>tar<\/code>.bz2<\/code>
\n <\/div>\ncd<\/code> mod_limitipconn-0.24<\/code>
\n <\/div>\n\/usr\/local\/apache2\/bin\/apxs<\/code> -c -i mod_limitipconn.c<\/code>
\n <\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\u7f16\u8f91httpd.conf<\/p>\n
\n\n\n\n<\/div>\n<\/td>\n\nExtendedStatus On<\/code>
\n <\/div>\nLoadModule limitipconn_module modules\/mod_limitipconn.so<\/code>
\n <\/div>\n <\/code> <\/div>\n<ifModule mod_limitipconn.c><\/code>
\n <\/div>\n<location \/> #\u5bf9\u5e94\u6839\u76ee\u5f55<\/code>
\n <\/div>\n <\/code>MaxConnPerIP 5 \uff03\u6700\u5927\u5e76\u53d1\u6570\u4e3a5<\/code>
\n <\/div>\n <\/code>NoIPLimit image\/* \uff03\u5bf9\u56fe\u7247\u4e0d\u505a\u9650\u5236<\/code>
\n <\/div>\n<\/location><\/code>
\n <\/div>\n<location \/test> \uff03\u5bf9\u6839\u76ee\u5f55\u4e0b\u7684test\u76ee\u5f55\u505a\u9650\u5236<\/code>
\n <\/div>\n <\/code>MaxConnPerIP 2 \uff03\u6700\u5927\u5e76\u53d1\u6570\u4e3a2<\/code>
\n <\/div>\n<\/location><\/code>
\n <\/div>\n<\/ifModule><\/code>
\n <\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\u5982\u679c\u60f3\u9650\u5236\u865a\u62df\u4e3b\u673a\u7684ip\u5e76\u53d1\u8fde\u63a5\u6570\uff0c\u53ef\u4ee5\u4fee\u6539extra\/httpd-vhost.conf\u628a IfModule mod_limitipconn.c \u8fd9\u4e00\u6bb5\u590d\u5236\u5230Virtualhost\u4e2d\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n
\u6d4b\u8bd5\uff1a
\u6d4b\u8bd5\u5f88\u7b80\u5355\uff0c\u628a\u6700\u5927\u8fde\u63a5\u6570\u8c03\u5c0f\u4e00\u70b9\uff0c\u968f\u4fbf\u4e00\u4e2a\u6d4f\u89c8\u5668\u8bbf\u95ee\u9875\u9762\uff0c\u7136\u540e\u6309\u7740F5\uff0c\u8ba9\u9875\u9762\u4e0d\u65ad\u5237\u65b0\uff0c\u4e00\u4e0b\u5c31\u53ef\u4ee5\u5f39\u51fa503\u9519\u8bef<\/p>\n
\u4f7f\u7528mod_bandwidth\u6a21\u5757\u9650\u5236\u5e26\u5bbd
<\/strong>mod_bandwidth\u53ef\u4ee5\u5bf9IP\u7684\u5e76\u53d1\u6570\u8fdb\u884c\u63a7\u5236\uff0c\u4e5f\u53ef\u4ee5\u5bf9\u4e0b\u8f7d\u6d41\u91cf\u8fdb\u884c\u63a7\u5236\uff0c\u4e5f\u53ef\u4ee5\u5bf9\u67d0\u4e2a\u76ee\u5f55\u7684\u6d41\u91cf\u8fdb\u884c\u63a7\u5236\u3002
\u5b89\u88c5\uff1a<\/p>\n