lua-nginx-module icon indicating copy to clipboard operation
lua-nginx-module copied to clipboard

Nginx 组合兼容编译太难了

Open landerson85 opened this issue 4 years ago • 11 comments

各种NGINX版本编译太难了,升一下级,不是这个找不到SO就是那个找不到,只能固定版本组合 有一种不想用的感觉

landerson85 avatar May 28 '21 12:05 landerson85

5月 29 03:54:08 localhost.localdomain nginx[18049]: 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 5月 29 03:54:08 localhost.localdomain nginx[18049]: no field package.preload['resty.core'] 5月 29 03:54:08 localhost.localdomain nginx[18049]: no file './resty/core.lua' 5月 29 03:54:08 localhost.localdomain nginx[18049]: no file '/usr/local/luajit/share/luajit-2.1.0-beta3/resty/core.lua' 5月 29 03:54:08 localhost.localdomain nginx[18049]: no file '/usr/local/share/lua/5.1/resty/core.lua' 5月 29 03:54:08 localhost.localdomain nginx[18049]: no file '/usr/local/share/lua/5.1/resty/core/init.lua' 5月 29 03:54:08 localhost.localdomain nginx[18049]: no file '/usr/local/luajit/share/lua/5.1/resty/core.lua' 5月 29 03:54:08 localhost.localdomain nginx[18049]: no file '/usr/local/luajit/share/lua/5.1/resty/core/init.lua' 5月 29 03:54:08 localhost.localdomain nginx[18049]: no file './resty/core.so' 5月 29 03:54:08 localhost.localdomain nginx[18049]: no file '/usr/local/lib/lua/5.1/resty/core.so' 5月 29 03:54:08 localhost.localdomain nginx[18049]: no file '/usr/local/luajit/lib/lua/5.1/resty/core.so' 5月 29 03:54:08 localhost.localdomain nginx[18049]: no file '/usr/local/lib/lua/5.1/loadall.so' 5月 29 03:54:08 localhost.localdomain nginx[18049]: no file './resty.so' 5月 29 03:54:08 localhost.localdomain nginx[18049]: no file '/usr/local/lib/lua/5.1/resty.so' 5月 29 03:54:08 localhost.localdomain nginx[18049]: no file '/usr/local/luajit/lib/lua/5.1/resty.so' 5月 29 03:54:08 localhost.localdomain nginx[18049]: no file '/usr/local/lib/lua/5.1/loadall.so') in /usr/local/nginx/conf/nginx.conf:70 5月 29 03:54:08 localhost.localdomain polkitd[637]: Unregistered Authentication Agent for unix-process:18043:274839 (system bus name :1.39, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale zh_CN.UTF-8) (disconnecte 5月 29 03:54:08 localhost.localdomain systemd[1]: nginx.service: control process exited, code=exited status=1

landerson85 avatar May 29 '21 03:05 landerson85

It's better to use the tarball below to build openresty/nginx, because it has applied many patches. https://github.com/openresty/openresty/tags

zhuizhuhaomeng avatar May 31 '21 00:05 zhuizhuhaomeng

It's better to use the tarball below to build openresty/nginx, because it has applied many patches. https://github.com/openresty/openresty/tags

It's so hard to compile, in fact, we need some other moduls, e.g. geo or brotli and so on.

Compile success ,but start failed image

charnet1019 avatar May 31 '21 03:05 charnet1019

you can add other modules as well. [zzhm@localhost openresty]$ ./configure --help | grep add --with-http_addition_module enable ngx_http_addition_module --add-module=PATH enable external module

zhuizhuhaomeng avatar May 31 '21 09:05 zhuizhuhaomeng

you can add other modules as well. [zzhm@localhost openresty]$ ./configure --help | grep add --with-http_addition_module enable ngx_http_addition_module --add-module=PATH enable external module

Follow the below instructions and compile success, but still start failed, the out error same as above. image

compile args:

--prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' --with-ld-opt= " -Wl,-rpath,/usr/local/lib " --add-module=/home/src/openresty-1.19.3.1/bundle/ngx_devel_kit-0.3.1 --add-module=/home/src/openresty-1.19.3.1/bundle/ngx_lua-0.10.19

charnet1019 avatar Jun 01 '21 03:06 charnet1019

It's better to use the tarball below to build openresty/nginx, because it has applied many patches. https://github.com/openresty/openresty/tags

we don't want to use openresty-nginx,we use nginx.org/nginx..., this error was appeared since version lua-nginx-module-0.10.15

unixchina avatar Jun 01 '21 10:06 unixchina

各种NGINX版本编译太难了,升一下级,不是这个找不到SO就是那个找不到,只能固定版本组合 有一种不想用的感觉

从模块lua-nginx-module-0.10.15这个版本开始出错的,以前的版本没有这个问题...

unixchina avatar Jun 01 '21 11:06 unixchina

can not find luajit directory in the configure command. @unixchina by the way, please use English here

zhuizhuhaomeng avatar Jul 26 '21 04:07 zhuizhuhaomeng

same problem. version:

nginx: 1.21.2 lua-nginx-module-0.10.20

 [alert] 6617#0: 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: module 'resty.core' not found:
        no field package.preload['resty.core']
        no file './resty/core.lua'
        no file '/home/luajit/share/luajit-2.1.0-beta3/resty/core.lua'
        no file '/usr/local/share/lua/5.1/resty/core.lua'
        no file '/usr/local/share/lua/5.1/resty/core/init.lua'
        no file '/home/luajit/share/lua/5.1/resty/core.lua'
        no file '/home/luajit/share/lua/5.1/resty/core/init.lua'
        no file './resty/core.so'
        no file '/usr/local/lib/lua/5.1/resty/core.so'
        no file '/home/luajit/lib/lua/5.1/resty/core.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file './resty.so'
        no file '/usr/local/lib/lua/5.1/resty.so'
        no file '/home/luajit/lib/lua/5.1/resty.so'

micookie avatar Sep 08 '21 12:09 micookie

same problem. version:

nginx: 1.21.2 lua-nginx-module-0.10.20

 [alert] 6617#0: 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: module 'resty.core' not found:
        no field package.preload['resty.core']
        no file './resty/core.lua'
        no file '/home/luajit/share/luajit-2.1.0-beta3/resty/core.lua'
        no file '/usr/local/share/lua/5.1/resty/core.lua'
        no file '/usr/local/share/lua/5.1/resty/core/init.lua'
        no file '/home/luajit/share/lua/5.1/resty/core.lua'
        no file '/home/luajit/share/lua/5.1/resty/core/init.lua'
        no file './resty/core.so'
        no file '/usr/local/lib/lua/5.1/resty/core.so'
        no file '/home/luajit/lib/lua/5.1/resty/core.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file './resty.so'
        no file '/usr/local/lib/lua/5.1/resty.so'
        no file '/home/luajit/lib/lua/5.1/resty.so'

resloved by https://github.com/openresty/lua-nginx-module/issues/1533#issuecomment-524082852

micookie avatar Sep 08 '21 15:09 micookie

我倒是组合编译成功了,毕竟就依赖一个luajit, 我遇到无解的是,不能静态链接libc, 因为gcc对静态链接会剔除动态符号表,导致nginx启动后lua报错找不到symbol

yxing-xyz avatar Nov 09 '23 10:11 yxing-xyz