Thakns for the quick reply ...
This shows the problem:
./configure --prefix=/or1
gmake
gmake install
cd /or1/lualib
create fred.lua, just a hello world
function hifred()
ngx.say("hi from fred")
end
cd /or1/nginx/conf
add following to location /
content_by_lua '
local fred = require("fred")
hifred()
';
cd ..
./sbin/nginx -p `pwd` -c conf/nginx.conf
This works fine, ./sbin/nginx -s stop
cd /
cp -r /or1 /or2
cd /or2/nginx
./sbin/nginx -p `pwd` -c conf/nginx.conf
This works fine, ./sbin/nginx -s stop
Now move the original instance
mv /or1 /or3
./sbin/nginx -p `pwd` -c conf/nginx.conf
This gives ...
./sbin/nginx: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory
Which suggests to me that despite the fact that i'm in /or2/nginx and using -p that no everything is taking note.
If we put /or3 back as /or1 then it will start ok.
moving /or1/lualib/fred.lua to /or2/lualib/fred.lua results in it not being found. Thats not too bad although not ideal as
I can get around that with lua_package_path.
Hope that explains what I'm seeing.
On Thursday, March 19, 2015 at 3:08:36 PM UTC, Ian Biggs wrote:
Normally when relocating Nginx, you'd use the -p flag to change the prefix path so that
everything runs neatly relative to that path.
Openresty does not appear to follow that prefix change so you end up running code from the location
specified during the build.
Not too much of a problem switching the package paths around (especially as all environment variables are available in init_by_lua via os.getenv() - guess this runs before Nginx strips them out).,
but the underlying paths (to LuaJIT etc) don't seem so easy to override.
Are there any thoughts about including a relocatable build option as seen in Perl (for instance)?
Alternatively, have everthing follow the -p prefix?
This is using 1.7.10.1.
Looks like I'm going to have to build for each path set I need to deploy to.
Use case is supporting multiple instances on the same server with the possibility
of running different patch levels for each instance, but a common build for any
given patch level.
Any best practive recommendations most welcome.
Thanks.