There are a batch of machines that need to deploy the same nginx. I want to copy the files directly after compiling once, but after copying, it prompts that a certain dependent library cannot be found.
Is there any way to compile it once and make it run on every machine?
You can use ldd and lsof to find out the shared libraries that the binary file nginx depends on, then copy them to a directory in nginx (such as
/png/pack/libs
), and then use patchelf to modify the rpath and interpreter of the binary file nginx:Then package the directory/png and deploy it to each server. For details, please refer to how I compiled and packaged PHP7 for 64-bit Linux distributions.
docker