Skip to content
This repository has been archived by the owner on May 29, 2023. It is now read-only.

用lua方式时这句话“require "ngx.dyups"”报错 #111

Open
xiongbenben opened this issue Feb 21, 2019 · 3 comments
Open

用lua方式时这句话“require "ngx.dyups"”报错 #111

xiongbenben opened this issue Feb 21, 2019 · 3 comments

Comments

@xiongbenben
Copy link

1、请问用lua方式具体应该怎样用,按照说明写在location的content_by_lua中时会报错找不到ngx.dyups。
2、用lua方式去更新upstream应该是时时写的,在location中不能够时时写,能说一下用lua方式具体怎么用吗

@chobits
Copy link
Collaborator

chobits commented May 6, 2019

To enable dyups LUA API, you MUST put --add-module=./lua-nginx-module in front of --add-module=./ngx_http_dyups_module in the ./configure command.

./configure编译命令的时候,请把lua-nginx-module放在dyups module之前

@piggsoft
Copy link

piggsoft commented Mar 19, 2020

@chobits 执行如下命令,还是无法获取ngx.dyups.版本2.3.2

./configure
--with-luajit-lib=/usr/local/lib/
--with-luajit-inc=/usr/local/include/luajit-2.0/
--with-lua-inc=/usr/local/include/luajit-2.0/
--with-lua-lib=/usr/local/lib/
--with-ld-opt=-Wl,-rpath,/usr/local/lib
--prefix=/home/nginx2
--add-module=./modules/ngx_http_lua_module
--add-module=../ngx_devel_kit
--add-module=./modules/ngx_http_upstream_dyups_module

@dzhcool
Copy link

dzhcool commented Nov 16, 2020

这个问题很好解决。

首先看下 ngx_http_upstream_dyups_module/config 文件

请注意这样一段代码:
shell if $HTTP_AUX_FILTER_MODULES | grep "ngx_http_lua_module" > /dev/null; then dyups_lua fi

所以,自己下载的lua_nginx_module 要改名成 ngx_http_lua_module,这样才会在 $HTTP_AUX_FILTER_MODULES|grep 'ngx_http_lua_module' 后判断加载了lua模块。只要判断编译参数加载了lua模块,会自动增加lua api支持的。

并且,请无视Tengine官网模块编译说明(页面),新版下面这个注释已经没有意义了,编译参数不存在的。
The module is not compiled into Tengine by default. It can be enabled with '--with-http_dyups_module' configuration parameter, and enabled lua support with '--with-http_dyups_lua_api'. But it can not be compiled as a '.so'.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants