I made the following hack. A recently installed compiled nginx with Passenger support installed, checked that it works correctly when launched from the command line, and then installed nginx with sudo yum install nginx (this is CentOS).
And finally, I looked for the *nginx* files in the /etc folder and replaced /usr/sbin/nginx with /opt/nginx/sbin/nginx . Then they rebooted the machine and were able to start nginx using sudo service nginx start .
Of course, there is a more elegant way to do this, but I'm lazy to learn how each Linux distribution service is registered.
I also replaced the paths for
nginx.confnginx.pid ( ${prog}.pid ) - otherwise it will not be able to stop nginx
source share