VPS侦探论坛

标题: lnmp1.9升级nginx到1.24.0 失败 [打印本页]

作者: yehkgu    时间: 2023-4-19 15:39
标题: lnmp1.9升级nginx到1.24.0 失败
本帖最后由 yehkgu 于 2023-4-19 15:40 编辑

大佬分析一下是什么原因,日志上传了
[attach]6696[/attach]


[attach]6695[/attach]


作者: licess    时间: 2023-4-19 17:46
        /root/lnmp1.9/src/lua-nginx-module-0.10.14/src/ngx_http_lua_headers_in.c
In file included from /usr/include/dlfcn.h:25:0,
                 from src/os/unix/ngx_linux_config.h:58,
                 from src/core/ngx_config.h:26,
                 from /root/lnmp1.9/src/lua-nginx-module-0.10.14/src/ddebug.h:11,
                 from /root/lnmp1.9/src/lua-nginx-module-0.10.14/src/ngx_http_lua_headers_in.c:10:
/root/lnmp1.9/src/lua-nginx-module-0.10.14/src/ngx_http_lua_headers_in.c:162:18: error: ‘ngx_http_headers_in_t’ has no member named ‘cookies’
                  offsetof(ngx_http_headers_in_t, cookies),
                  ^
make[1]: *** [objs/addon/src/ngx_http_lua_headers_in.o] Error 1

nginx 1.23.0 开始API发生变化导致的 http://nginx.org/en/CHANGES
  *) Change in internal API: now header lines are represented as linked
       lists.

启用lua模块升级nginx到1.23.0及更高版本的话目前只能使用lnmp 2.0进行升级
作者: yehkgu    时间: 2023-4-20 09:25
licess 发表于 2023-4-19 17:46
nginx 1.23.0 开始API发生变化导致的 http://nginx.org/en/CHANGES

启用lua模块升级nginx到1.23.0及更高 ...

我也用lnmp 2.0 测试版升级过,还是会失败
还遇到这样情况用2.0测试版直接安装nginx 1.24.0 ++lua可以,重启nginx就会报错,重启失败,然后就永远不行了
作者: licess    时间: 2023-4-20 10:29
yehkgu 发表于 2023-4-20 09:25
我也用lnmp 2.0 测试版升级过,还是会失败
还遇到这样情况用2.0测试版直接安装nginx 1.24.0 ++lua可以, ...

前几天更新的代码忘记同步了,你重新下载lnmp2.0的测试版进行升级
作者: yehkgu    时间: 2023-4-21 13:12
licess 发表于 2023-4-20 10:29
前几天更新的代码忘记同步了,你重新下载lnmp2.0的测试版进行升级

谢谢,已经解决这个问题

就是重启nginx会有一个提醒
Stoping nginx...  done
Starting nginx... nginx: [alert] detected an old version of OpenResty's LuaJIT missing the lua_resetthread API and thus the performance will be compromised; please upgrade to the latest version of OpenResty's LuaJIT: https://github.com/openresty/luajit2
nginx: [alert] detected an old version of OpenResty's LuaJIT missing the exdata2 API and thus the performance will be compromised; please upgrade to the latest version of OpenResty's LuaJIT: https://github.com/openresty/luajit2
done

不知道能不能屏蔽了这个提醒,虽然不影响功能使用,就是觉得好多余,哈哈!!!非常感谢licess
作者: yehkgu    时间: 2023-4-21 13:36
本帖最后由 yehkgu 于 2023-4-21 13:45 编辑


[attach]6699[/attach]

如果在环境中加入了waf就会报错这个

即使在后面配置去掉加上的waf代码依然会报错这个

同样配置在lnmp1.9+nginx1.22.0环境下测试正常用的


作者: yehkgu    时间: 2023-4-21 13:37
本帖最后由 yehkgu 于 2023-4-21 13:46 编辑

下载的是最新更新的lnmp2.0测试版

感觉就是触发了luajit模块,然后就不断有这个报错出现了

作者: yehkgu    时间: 2023-4-21 14:08
[attach]6700[/attach]

作者: yehkgu    时间: 2023-4-21 14:23
本帖最后由 yehkgu 于 2023-4-21 14:29 编辑

[attach]6701[/attach]


确认了这个报错是存在的

我又全新卸载了lnmp后 重装一次
卸载是用 ./uninstall.sh

然后安装nginx 是用 ./install.sh nginx

lnmp.conf 安装配置是启用nginx_lua,这一点没问题的

  1. Enable_Nginx_Openssl='y'
  2. Enable_Nginx_Lua='y'
  3. Enable_Ngx_FancyIndex='n'
  4. Enable_Swap='y'
  5. Enable_PHP_Exif='n'
  6. Enable_PHP_Fileinfo='n'
  7. Enable_PHP_Ldap='n'
  8. Enable_PHP_Bz2='n'
  9. Enable_PHP_Sodium='n'
  10. Enable_PHP_Imap='n'
复制代码


安装完成后重启nginx是没问题

如果加入waf防火墙命令就出问题了 ,下面是插入nginx.conf 里的代码
  1. lua_shared_dict limit 50m;
  2.         lua_package_path "/usr/local/nginx/conf/waf/?.lua";
  3.         init_by_lua_file "/usr/local/nginx/conf/waf/init.lua";
  4.         access_by_lua_file "/usr/local/nginx/conf/waf/access.lua";
复制代码

[attach]6702[/attach]

在lnmp1.9+1.22.0 环境下正常使用,在lnmp2.0测试版+nginx1.24.0 下面就会报错nginx启动不了了

应该是和luajit有关,这个报错重现还是很容易的。


作者: licess    时间: 2023-4-21 14:58
yehkgu 发表于 2023-4-21 13:12
谢谢,已经解决这个问题

就是重启nginx会有一个提醒

这个应该是你机器上老版本的luajit导致的,rm -rf /usr/local/luajit 删除后重新升级一下就会安装上新版的luajit就可以了
作者: yehkgu    时间: 2023-4-21 15:29
licess 发表于 2023-4-21 14:58
这个应该是你机器上老版本的luajit导致的,rm -rf /usr/local/luajit 删除后重新升级一下就会安装上新版 ...

终于搞明白了,是lnmp2.0+nginx1.24.0  安装后,lua的目录改变了

新的目录是在 /usr/local/nginx/lib/lua 下面

谢谢,解决问题!




欢迎光临 VPS侦探论坛 (https://bbs.lnmp.com/) Powered by Discuz! X3.4