I searched google for deploying multiple rails websites using phusion passenger 3.0.17 with nginx but I didn’t get relevant results. Any how I completed passenger nginx setup by running passenger-install-nginx-module command.
Ques 1) I am looking for proper beginner tutorial for running multiple rails websites using phusion passenger 3.0.17 with nginx
Ques 2) I am looking commands for start, stop, restart the (whole passenger nginx server (ie) for all websites) and also for (Individual rails websites)
Note: I am not looking for passenger standalone solution. I am using REE 1.8.7 and rails 2.3.14
According to the documentation for Passenger, you create a new vhost for each app you want to deploy.
And point the site
rootat your apps public directory, and add thepassenger_enableddirective. Exactly the same as deploying with Apache.More here: http://www.modrails.com/documentation/Users%20guide%20Nginx.html#deploying_a_ror_app
In regards question 2. Restarting depends on what you are trying to do. I’m going to assume you’re using a distro that uses
init.dThese are 3 cases where you do a different kind of ‘restart’.
You have an issue with some config you have on Nginx. Or it’s behaving strangely.
So you would restart the Nginx service like this:
/etc/init.d/nginx restartThe next case is you have a rails or sinatra app deployed on Nginx with the passenger module.
And you want to make it reload some changes you just pushed to the server.
Passenger watches the
tmp/restart.txtfile in your application. So by simply runngingtouch tmp/restart.txt. While cd’d into the app’s folder will tell Passenger to reload the application.And the last case for restarting/reloading is reload for Nginx.
You use this when you add or change your VHOSTs.
/etc/init.d/nginx reload. This allows you to reload your vhosts and other config without dropping connections.Have a gander at the Passenger Documentation, it is very thorough. nginx-passenger docs