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 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 nginx using:

sudo service nginx stop
sudo service nginx start
sudo service nginx restart
sudo service nginx reload

Comments

Popular Posts

How to pass hash in Postman

Reading Excel Sheets using "Roo" gem in ruby on rails

Bootstrap Select Picker append add new item if search not exist

Add CORS to Nginx on AWS Elastic Beanstalk

Enable gzip compression on Elastic Beanstalk with nginx

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

Get video duration by URL in Ruby on Rails

site-enables nginx setting in ruby in rails