recompile nginx installed from repository

I installed Nginx 1.10.3 on a Debian 8 from the official repository monthes ago.
Since I wanted to load a new module, I had to download nginx sources (still 1.10.3) and recompile it so that it generates the my_desired_module.so I need.
Nginx installed from the repo is the one currently running and is located at /etc/nginx

The new Nginx I compiled is located at /usr/local/nginx and is not running I guess.
I thought I was a smart guy and just copied the my_desired_module.so newly generated into the /modules-enabled/ directory of my running Nginx. I thought it would work since I compiled from version 1.10.3 but it throws a is not binary compatible error within nginx logs :-)

Obviously I'm not a smart guy, so I considered saving my conf files, removing the current running Nginx (which was install from the repo), and run the nginx I freshly compiled.
However, I do not want to mess things up with the bin and sbin and nginx.pid as it seems to me that a command like service nginx restart is still handled by the nginx I installed from the repo, not by the nginx I just compiled.

Question: How do I make it so that the nginx I compiled takes it over the nginx I installed from the repo?
The compiled nginx's sbin is /usr/local/nginx/sbin/nginx
While the currently running nginx's sbin is /usr/sbin/nginx

链接地址: http://www.djcxy.com/p/95192.html

上一篇: Nginx从源代码安装模块,在从存储库安装之后

下一篇: 重新编译从存储库安装的nginx