Following the How to install rails and nginx with passenger on Ubuntu tutorial from DigitalOcean.com, the seventh step manually starts nginx:
sudo service nginx start
but fails with the following error:
nginx: unrecognized service
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 https://www.linode.com/docs/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
Now we can control
sudo service nginx stop sudo service nginx start sudo service nginx restart sudo service nginx reload