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
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With