intruxxer
12/28/2013 - 3:24 PM

From here: https://www.digitalocean.com/community/articles/how-to-install-rails-and-nginx-with-passenger-on-ubuntu INSTALL RAILS with PAS

From here: https://www.digitalocean.com/community/articles/how-to-install-rails-and-nginx-with-passenger-on-ubuntu

INSTALL RAILS with PASSENGER gem + passenger-module-nginx

It doesnt work without this fix for "nginx: unrecognized service" error.

From above excellent article "Installing Nginx with Phusion Passenger with module from Passenger", it lacks init script in /etc/init.d/nginx to start/restart/stop the service. Further, to add site to your apps,

https://www.digitalocean.com/community/articles/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3

http://www.sitepoint.com/deploying-rails-with-phusion-passenger-and-nginx-in-5-minutes/

http://askubuntu.com/questions/257108/trying-to-start-nginx-on-vps-i-get-nginx-unrecognized-service
 
============================================
The "nginx: unrecognized service" error means the startup scripts need to be created.
 
Fortunately the startup scripts have already been written.
 

We can fetch them with wget and set them up following these steps:
 

# Download nginx startup script
 
wget -O init-deb.sh http://library.linode.com/assets/660-init-deb.sh
 

# Move the script to the init.d directory & make executable
 
sudo mv init-deb.sh /etc/init.d/nginx
 
sudo chmod +x /etc/init.d/nginx
 

# Add nginx to the system startup
 
sudo /usr/sbin/update-rc.d -f nginx defaults