openresty / lua-nginx-module

Embed the Power of Lua into NGINX HTTP servers
https://openresty.org/
11.34k stars 2.04k forks source link

Nginx+lua-nginx-module+luajit2-2.1 nginx启动报错 #1723

Open LLj-github opened 4 years ago

LLj-github commented 4 years ago

/usr/local/nginx-1.16.1/sbin/nginx nginx: [error] failed to run the Lua code for coroutine.wrap(): 2: coroutine.wrap:2: module 'thread.exdata' not found: no field package.preload['thread.exdata'] no file './thread/exdata.lua' no file '/usr/local/share/luajit-2.0.4/thread/exdata.lua' no file '/usr/local/share/lua/5.1/thread/exdata.lua' no file '/usr/local/share/lua/5.1/thread/exdata/init.lua' no file './thread/exdata.so' no file '/usr/local/lib/lua/5.1/thread/exdata.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file './thread.so' no file '/usr/local/lib/lua/5.1/thread.so' no file '/usr/local/lib/lua/5.1/loadall.so'

yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel 下载LuaJIT wget https://luajit.org/download/luajit2-2.1.tar.gz 下载ngx_devel_kit wget https://github.com/vision5/ngx_devel_kit/archive/v0.3.1.tar.gz 下载ngx_lua https://github.com/openresty/lua-nginx-module/archivev/0.10.14.tar.gz 下载nginx wget https://nginx.org/download/nginx-1.16.1.tar.gz

LLj-github commented 4 years ago

nginx服务和端口是启动起来了,但是启动有error

zhuizhuhaomeng commented 4 years ago

Please provide detailed compilation steps. It seem that luajit is not used at all.

You can refer to the links below https://github.com/openresty/openresty-packaging/blob/master/rpm/SPECS/openresty.spec#L185

yinpeng-cn commented 1 year ago

same error on aarch64 OS is openerlur20.03SP3 git clone https://github.com/openresty/lua-nginx-module.git -b v0.10.24 git clone https://github.com/openresty/stream-lua-nginx-module.git -b v0.0.13 git clone https://github.com/openresty/luajit2.git -b v2.1-20230410 git clone https://github.com/vision5/ngx_devel_kit.git -b v0.3.2 git clone https://github.com/openresty/lua-resty-lrucache.git -b v0.13 git clone https://github.com/openresty/lua-nginx-module.git -b v0.10.21 git clone https://github.com/openresty/lua-resty-core.git -b v0.1.26

[root@wgw-oe2003-ppy sbin]# ./nginx -V nginx version: nginx/1.19.3 built by gcc 7.3.0 (GCC) built with OpenSSL 1.1.1f 31 Mar 2020 TLS SNI support enabled configure arguments: --prefix=/opt/nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-ld-opt=-Wl,-rpath,/usr/local/lib/luajit/lib --add-module=/home/ppy/wgw/ngx_devel_kit --add-module=/home/ppy/wgw/lua-nginx-module --with-cc-opt='-DNGX_LUA_USE_ASSERT -DNGX_LUA_ABORT_AT_PANIC'

[root@wgw-oe2003-ppy sbin]# ./nginx nginx: [error] failed to run the Lua code for coroutine_api: 2: coroutine_api:2: module 'thread.exdata' not found: no field package.preload['thread.exdata'] no file '/opt/nginx/lib/lua/thread/exdata.lua' no file './thread/exdata.lua' no file '/usr/share/luajit-2.1.0-beta3/thread/exdata.lua' no file '/usr/local/share/lua/5.1/thread/exdata.lua' no file '/usr/local/share/lua/5.1/thread/exdata/init.lua' no file '/usr/share/lua/5.1/thread/exdata.lua' no file '/usr/share/lua/5.1/thread/exdata/init.lua' no file './thread/exdata.so' no file '/usr/local/lib/lua/5.1/thread/exdata.so' no file '/usr/lib64/lua/5.1/thread/exdata.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file './thread.so' no file '/usr/local/lib/lua/5.1/thread.so' no file '/usr/lib64/lua/5.1/thread.so' no file '/usr/local/lib/lua/5.1/loadall.so' nginx: [alert] failed to load the 'resty.core' module (https://github.com/openresty/lua-resty-core); ensure you are using an OpenResty release from https://openresty.org/en/download.html (reason: /opt/nginx/lib/lua/resty/core/base.lua:24: ngx_http_lua_module 0.10.24 required) in /opt/nginx/conf/nginx.conf:117

follow the below step to install nginx https://github.com/openresty/lua-nginx-module#installation image full excute step then to start nginx, throw the top errors

how can i resolve the problem only use this module in nginx simplely

additional info: i have excute commond " find / -name thread.so " and " find / -name exdata.lua " ,there is no file in os.

zhuizhuhaomeng commented 1 year ago

you can use ldd nginx to check the path of libluajit.so