Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have two sites running on two Linode servers.

When I restart server #1, it automatically starts NGINX again right away

When I restart server #2, it does not!

How can I configure my server so that it restarts NGINX when I reboot the server?

Thanks in advance...

Bo

share|improve this question

migrated from stackoverflow.com Jun 13 '11 at 1:15

This question came from our site for professional and enthusiast programmers.

    
how you have installed nginx? which os? does apache is also installed? –  pragnesh Jun 13 '11 at 4:09

2 Answers 2

Put in /etc/rc.local:

/www/nginx/sbin/nginx (or what you path is)
share|improve this answer

If your using ubuntu you can use update-rc.d

update-rc.d nginx enable 2345

or if your using a redhat based system

chkconfig nginx --level 2345 on
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.