Using OpenResty, I compiled and installed a Lua-capable Nginx in /tmp so
I
could experiment with it before replacing the current Nginx that was
installed through apt-get.
However, since files are located in non-standard locations, Nginx can’t
find
them:
/tmp/ngx_openresty-1.4.3.6/install/usr/local/openresty/nginx/sbin#
./nginx
./nginx: error while loading shared libraries: libluajit-5.1.so.2:
cannot
open shared object file: No such file or directory
FYI, here’s what tmp/ngx_openresty-1.4.3.6/install/usr/local/openresty/
contains:
drwxr-xr-x 6 root root 4096 Jan 21 16:01 luajit/
drwxr-xr-x 5 root root 4096 Jan 21 16:03 lualib/
drwxr-xr-x 6 root root 4096 Jan 21 16:01 nginx/
How should configure Debian so that Nginx find the files it needs?
./nginx: error while loading shared libraries: libluajit-5.1.so.2: cannot
open shared object file: No such file or directory
How should configure Debian so that Nginx find the files it needs?
You can always write ‘ldd nginx’ (also for every other executable on
linux)
to see where the librariers (*.so) should be located (it will indicate
‘not
found’ and display path).
./nginx: error while loading shared libraries: libluajit-5.1.so.2:
cannot open shared object file: No such file or directory
How should configure Debian so that Nginx find the files it needs?
You can always write ‘ldd nginx’ (also for every other executable on
linux) to see where the librariers (*.so) should be located (it will
indicate ‘not found’ and display path).
Perhaps Yichun Z. (agentzh) will have a simpler approach, but you can
also consider setting up a virtual machine using VirtualBox or some
other program, and testing it that way. Once you are convinced that it
behaves as expected for your use case, you can install it and try it in
production.
Also, in Debian you can use apt-file to find the necessary lib:
aptitude install apt-file && apt-file update
apt-file search libluajit
or
apt-file search -x ‘libluajit.*.so$’
On Friday, January 24, 2014 09:43:55 AM Shohreh wrote:
./nginx: error while loading shared libraries: libluajit-5.1.so.2: cannot
How should configure Debian so that Nginx find the files it needs?
Thanks for the idea, but I had to compile Nginx because the one
available in
the depot didn’t have Lua compiled, and I’d rather compile both Nginx
and
Lua at the same time.
Using OpenResty, I compiled and installed a Lua-capable Nginx in /tmp so I
could experiment with it before replacing the current Nginx that was
installed through apt-get.
However, since files are located in non-standard locations, Nginx can’t find
them:
You should use the command
./configure --prefix=/tmp/openresty --with-luajit
to build your openresty.
You cannot move already installed openresty directory tree to other
places because we use RPATH in the “nginx” executable file’s header to
locate dynamic libraries (like the libluajit-5.1.so.2 file).