使用原机的lnmp的更新脚本报错,就使用手动下载nginx1.30.1来编译
必须使用老nginx -V的configure参数来编译1.30.1,不然会出现丢失已经在使用的模块。
1、编译报错,lua-nginx-module 版本旧了,下载新版本后通过。下载lua-nginx-module 和 ngx_devel_kit ,然后指定源码目录。
下载相关的Lua模块到最新版本:
2、编译还报错,会提示有个变量重复的错误,到chatgpt问,根据提示,修改 lua-nginx-module 源码(注释了一行)后编译通过。
3、nginx 1.30.1生成后,-t 正常,但是运行会报错 lua-resty-core 找不到,去下载安装
还需要指定 nginx.conf 中 lua_package_path,加上resty-core路径, /usr/local/lib/lua/?.lua
4、运行新nginx还是报错,找不到 lua-resty-lrucache ,去下载安装
5、现在运行下 nginx1.30.1 就不报错了,现在就可以替换nginx,然后平滑升级下
p.s. 最好是luajit也升级下,不过没有报错就算了,多一事不如少一事。
使用的是openresty的luajit2,下载地址: https://github.com/openresty/luajit2
评论Feed: http://blog.xg98.com/feed.asp?q=comment&id=3015
必须使用老nginx -V的configure参数来编译1.30.1,不然会出现丢失已经在使用的模块。
1、编译报错,lua-nginx-module 版本旧了,下载新版本后通过。下载lua-nginx-module 和 ngx_devel_kit ,然后指定源码目录。
下载相关的Lua模块到最新版本:
https://github.com/openresty/lua-nginx-module/archive/v0.10.29.tar.gz
https://github.com/vision5/ngx_devel_kit/archive/refs/tags/v0.3.3.tar.gz
https://github.com/vision5/ngx_devel_kit/archive/refs/tags/v0.3.3.tar.gz
2、编译还报错,会提示有个变量重复的错误,到chatgpt问,根据提示,修改 lua-nginx-module 源码(注释了一行)后编译通过。
ngx_http_lua_api.h:26: 错误:typedef‘ngx_http_lua_co_ctx_t’重定义
src/api/ngx_http_lua_api.h/*
typedef struct ngx_http_lua_co_ctx_s ngx_http_lua_co_ctx_t;
*/
typedef struct ngx_http_lua_co_ctx_s ngx_http_lua_co_ctx_t;
*/
3、nginx 1.30.1生成后,-t 正常,但是运行会报错 lua-resty-core 找不到,去下载安装
cd /usr/local/src
wget https://github.com/openresty/lua-resty-core/archive/refs/tags/v0.1.32.tar.gz
tar -zxvf v0.1.32.tar.gz
cd lua-resty-core-0.1.32
make install PREFIX=/usr/local
安装后,/usr/local/lib/lua/resty/ 就有了文件。wget https://github.com/openresty/lua-resty-core/archive/refs/tags/v0.1.32.tar.gz
tar -zxvf v0.1.32.tar.gz
cd lua-resty-core-0.1.32
make install PREFIX=/usr/local
还需要指定 nginx.conf 中 lua_package_path,加上resty-core路径, /usr/local/lib/lua/?.lua
lua_package_path = "/usr/local/lib/lua/?.lua;******";
4、运行新nginx还是报错,找不到 lua-resty-lrucache ,去下载安装
cd /usr/local/src
wget https://github.com/openresty/lua-resty-lrucache/archive/refs/tags/v0.13.tar.gz
tar -zxvf v0.13.tar.gz
cd lua-resty-lrucache-0.13
make install PREFIX=/usr/local
安装好后 ,/usr/local/lib/lua/resty/ 就有了 lrucache 的文件wget https://github.com/openresty/lua-resty-lrucache/archive/refs/tags/v0.13.tar.gz
tar -zxvf v0.13.tar.gz
cd lua-resty-lrucache-0.13
make install PREFIX=/usr/local
5、现在运行下 nginx1.30.1 就不报错了,现在就可以替换nginx,然后平滑升级下
p.s. 最好是luajit也升级下,不过没有报错就算了,多一事不如少一事。
使用的是openresty的luajit2,下载地址: https://github.com/openresty/luajit2
[最后修改由 admin, 于 2026-05-16 17:35:20]
评论Feed: http://blog.xg98.com/feed.asp?q=comment&id=3015
这篇日志没有评论。
此日志不可发表评论。






