The normal installation of passenger usually require you to either do
1. passenger-install-nginx-module, or
2. go to nginx source and reinstall manually with extra –add-module /path-to-passenger-module
I am a bit reluctant to do option-1 because I already have some modules running with my nginx and option-2 is a bit troublesome because I install nginx with apt-get so I dont keep the source code.
Instead I found the official instruction which show me how to upgrade nginx installation in ubuntu.
sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 561F9B9CAC40B2F7
sudo apt-get install apt-transport-https
Create a file /etc/apt/sources.list.d/passenger.list and insert one of the following lines, depending on your distribution.
##### !!!! Only add ONE of these lines, not all of them !!!! #####
# Ubuntu 13.10
deb https://oss-binaries.phusionpassenger.com/apt/passenger saucy main
# Ubuntu 12.04
deb https://oss-binaries.phusionpassenger.com/apt/passenger precise main
# Ubuntu 10.04
deb https://oss-binaries.phusionpassenger.com/apt/passenger lucid main
sudo chown root: /etc/apt/sources.list.d/passenger.list
sudo chmod 600 /etc/apt/sources.list.d/passenger.list
sudo apt-get update
sudo apt-get install nginx-extras passenger
Edit /etc/nginx/nginx.conf and uncomment passenger_root and passenger_ruby.
sudo service nginx restart
add config file to your site-available
server {
listen 80;
server_name example.com;
passenger_enabled on;
root /var/www/my_rails_app/public;
}
if you don’t have nodejs already, install it with this command:
sudo apt-get install nodejs