Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nginx service won't start after reboot AWS Linux server

A few weeks ago I configured an ec2 server on AWS and database is on RDS and I use nginx as web server. When i reboot server from the AWS console my nginx wont restart automatically. I did this using service nginx start command.

Is there any way to configure nginx server, So it restarted when i reboot my ec2 instance

like image 770
rash111 Avatar asked Jul 12 '16 09:07

rash111


People also ask

Why is nginx not running?

If nginx does not start, look for the reason in the error log file logs\error. log . If the log file has not been created, the reason for this should be reported in the Windows Event Log. If an error page is displayed instead of the expected page, also look for the reason in the logs\error.

What happens when you reboot an ec2 instance?

When you reboot an instance, it keeps its public DNS name (IPv4), private and public IPv4 address, IPv6 address (if applicable), and any data on its instance store volumes. Rebooting an instance doesn't start a new instance billing period (with a minimum one-minute charge), unlike stopping and starting your instance.


1 Answers

You may configure nginx to start automatically on system boot using below command.

 #chkconfig nginx on

Once you run above command, nginx will be always started whenever system boots.

You may check , if service is configured to start automaticaly on system boot using below command.

# chkconfig nginx --list

You may disable service auto start using below command

# chkconfig nginx off
like image 87
Shubhangi Avatar answered Oct 26 '22 23:10

Shubhangi