首页自学LuaJIT-2.1.0相关以及ngx_lua_waf防火墙配置相关

LuaJIT-2.1.0相关以及ngx_lua_waf防火墙配置相关

adminadmin时间2024-06-28 19:08:39分类自学浏览39
wget https://www.isres.com/file/LuaJIT-2.1.0-beta3.tar.gz
tar -zxvf LuaJIT-2.1.0-beta3.tar.gz
cd LuaJIT-2.1.0-beta3
make && make install

export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/usr/local/include/luajit-2.1
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH


# lua -v
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio

cd ../


wget https://www.isres.com/file/ngx_devel_kit.zip
unzip ngx_devel_kit.zip
wget https://www.isres.com/file/lua-nginx-module.zip
unzip lua-nginx-module.zip

如果已经安装有nginx 的nginx -V 看看还有什么第三方模块
configure arguments: --prefix=/usr/local/nginx --user=www --group=www --with-mail --with-mail_ssl_module --with-http_ssl_module --with-http_flv_module --with-http_dav_module --with-http_sub_module --with-http_realip_module --with-http_addition_module --with-http_gzip_static_module --with-http_stub_status_module --with-pcre --add-module=/usr/tmp/ngx_cache_purge-master/ --add-module=/usr/tmp/ngx_http_substitutions_filter_module-master

wget https://www.isres.com/file/ngx_cache_purge-2.3.tar.gz
tar -zxvf ngx_cache_purge-2.3.tar.gz
wget https://www.isres.com/file/ngx_http_substitutions_filter_module.tar.gz
tar -zxvf ngx_http_substitutions_filter_module.tar.gz

wget https://www.isres.com/file/nginx-1.15.5.tar.gz
tar -zxvf nginx-1.15.5.tar.gz && cd nginx-1.15.5/

./configure --prefix=/usr/local/nginx \
--user=www --group=www --with-mail --with-mail_ssl_module --with-http_ssl_module \
--with-http_flv_module --with-http_dav_module --with-http_sub_module --with-http_realip_module \
--with-http_addition_module --with-http_gzip_static_module --with-http_stub_status_module \
--with-pcre --add-module=/usr/tmp/ngx_cache_purge-2.3/ \
--add-module=/usr/tmp/ngx_http_substitutions_filter_module-0.6.4 \
--add-module=/usr/tmp/lua-nginx-module-master \
--add-module=/usr/tmp/ngx_devel_kit-master

make
make install

###本人已经有原来旧的改过的规则

cd /usr/local/nginx/
tar -zxvf waf.tar.gz
mv waf conf/


vim conf/nginx.conf

添加

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;

cd conf/waf
vim config.lua

#logdir = "/usr/local/nginx/logs/hack/" 需要提前建目录
/usr/local/nginx/logs/hack
chown -R www:www /usr/local/nginx/logs/hack

nginx -t
service nginx restart

报错  error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory

echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig
service nginx restart



ngx_lua_waf防火墙配置相关
https://github.com/loveshell/ngx_lua_waf

本文《LuaJIT-2.1.0相关以及ngx_lua_waf防火墙配置相关》bushu/8.html

与《LuaJIT-2.1.0相关以及ngx_lua_waf防火墙配置相关》

0
0
收藏0
宁波方正:实际控制人增持计划完成

    未登录用户 回复需填写必要信息
    请先 登录 再评论,若不是会员请先 注册