本帖最后由 Libws 于 2023-8-14 15:06 编辑
我不用Apache防火墙,应该是没有的
如果你安装的是Nginx的Tengine/Openresty或者别的版本,甚至稳定版都可能都会遇到如下报错
[Lua] 纯文本查看 复制代码 启动失败:
nginx: [alert] failed to load the 'resty.core' module ([url=https://github.com/openresty/lua-resty-core]https://github.com/openresty/lua-resty-core[/url]); ensure you are using an OpenResty release from [url=https://openresty.org/en/download.html]https://openresty.org/en/download.html[/url] (reason: module 'resty.core' not found:
no field package.preload['resty.core']
no file '/www/server/btwaf/resty/core.lua'
no file '/www/server/nginx/site/lualib/resty/core.so'
no file '/www/server/nginx/lualib/resty/core.so'
no file './resty/core.so'
no file '/usr/local/lib/lua/5.1/resty/core.so'
no file '/www/server/nginx/luajit/lib/lua/5.1/resty/core.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '/www/server/nginx/site/lualib/resty.so'
no file '/www/server/nginx/lualib/resty.so'
no file './resty.so'
no file '/usr/local/lib/lua/5.1/resty.so'
no file '/www/server/nginx/luajit/lib/lua/5.1/resty.so'
no file '/usr/local/lib/lua/5.1/loadall.so') in /www/server/nginx/conf/nginx.conf:96
不要惊慌,也不要去重装Nginx,加俩分号就能解决
去到/www/server/panel/vhost/nginx这个目录,打开btwaf.conf这个配置文件
定位到lua_package_path这一行,后面的内容应该是"/www/server/btwaf/?.lua",在?.lua的后面加上两个半角分号(;;)
完成后大概是这样:
[Lua] 纯文本查看 复制代码 lua_shared_dict spider 10m;
lua_shared_dict btwaf 30m;
lua_shared_dict drop_ip 30m;
lua_shared_dict drop_sum 30m;
lua_shared_dict btwaf_data 100m;
lua_package_path "/www/server/btwaf/?.lua;;";
init_by_lua_file /www/server/btwaf/init.lua;
access_by_lua_file /www/server/btwaf/waf.lua;
header_filter_by_lua_file /www/server/btwaf/header.lua;
body_filter_by_lua_file /www/server/btwaf/body.lua;
然后去重启Nginx就可以了,如果Nginx防火墙还是报错就去修面板吧
(宝塔啊,长点心吧,就俩分号都能漏了)
|