Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I add passenger support to a existed Nginx instead of rebuild one?

I have a server running with nginx serving two php websites, right now I want to make it serving a rails app, I've googled, but there no notes about add passenger support to a existed nginx, all of them are telling me run passenger-install-nginx-module to build a nginx.

Can I add passenger support to my nginx instead of rebuild it?

Thanks for any helps.

like image 781
C.C. Avatar asked Nov 23 '25 14:11

C.C.


1 Answers

You still need to rebuild nginx. If you run passenger-install-nginx-module you will see this output:

Nginx doesn't support loadable modules such as some other web servers do, so in order to install Nginx with Passenger support, it must be recompiled.

See Installing Passenger as a normal Nginx module for steps.

cd /path-to-nginx-source-dir
./configure --prefix=/opt/nginx \
  --add-module=$(passenger-config --nginx-addon-dir) \
  --add-module=/path-to-some-nginx-module
make
sudo make install

The value for /path-to-passenger-module can be obtained with the command:

passenger-config --nginx-addon-dir
like image 94
Pavel Chuchuva Avatar answered Nov 25 '25 03:11

Pavel Chuchuva