复制代码 代码如下:
#!/bin/sh
nginx_home = /Data/app_1/nginx
log_path = /Data/logs
/usr/bin/tail -n50000 $log_path/access.log /
|awk ‘$8 ~/aspx/{print $2,$13}' /
|grep -i -v -E “google|yahoo|baidu|msnbot|FeedSky|sogou” /
|awk ‘{print $1}'|sort|uniq -c |sort -rn /
|awk ‘{if($1>150)print “deny “$2″;”}'> $nginx_home/conf/vhosts/blockip.conf
/bin/kill -HUP `cat $nginx_home/nginx.pid`
新闻热点
疑难解答
图片精选