Nginx-lua-CCDeny

nginx:http://nginx.org/download/nginx-1.17.8.tar.gz

ngx_devel_kit:https://github.com/vision5/ngx_devel_kit/archive/master.zip

lua-nginx-module:建议版本:https://github.com/openresty/lua-nginx-module/archive/v0.10.13.zip(14,15)

https://github.com/openresty/luajit2/archive/v2.1-20200102.zip

make && make install PREFIX=/usr/local/lj2

export LUAJIT_LIB=/usr/local/lj2/lib/

export LUAJIT_INC=/usr/local/lj2/include/luajit-2.1

./configure --prefix=/usr/local/nginx \
--add-module=/usr/local/src/ngx_devel_kit/ \
--add-module=/usr/local/src/lua-nginx-module/

./sbin/nginx: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory
ln -s /usr/local/lj2/lib/libluajit-5.1.so.2 /lib64/

------------------------------------------------------------------------------

ngx_lua_waf:https://github.com/loveshell/ngx_lua_waf

https://github.com/loveshell/ngx_lua_waf/archive/master.zip

mv ngx_lua_waf-master/* /usr/local/nginx/conf/waf/

在nginx.conf的http段添加;
lua_package_path "/usr/local/nginx/conf/waf/?.lua";
lua_shared_dict limit 10m;
init_by_lua_file  /usr/local/nginx/conf/waf/init.lua; 
access_by_lua_file /usr/local/nginx/conf/waf/waf.lua;

 CCDeny:vim /usr/local/nginx/conf/waf/config.lua CCDeny="on"

CCrate="100/60" # 限制60秒100个请求

yum -y install httpd-tools

ab -n 100000 -c 100 http://192.168.1.100/index.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值