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

I have installed nginx on my Ubuntu 10.04 box. With passenger 3.

Now I've got everything setup correctly; how do I ensure that nginx will start on boot everytime?

share|improve this question

3 Answers 3

Yo can use the command sysv-rc-conf. This will show you the active link in each run level. You can also change the links (add or delete them) by just hitting the space bar on the highlighted cell in the shown table.

Be careful, any change will be immediately applied.

share|improve this answer
    
If you did not find nginx in the table, you may need to copy its startup under /etc/init.d. –  Khaled Jan 11 '12 at 15:17

If you installed from the deb package using dpkg or apt-get then you should be good to go.

Otherwise, the way to do this is to create a startup script. Likely nginx already has one created for just such a purpose, although you could create one if you really wanted to.

These scripts go into /etc/init.d and are run by the startup process. Using sysv-rc-conf or chkconfig helps to enable or disable these scripts, controlling whether things start or not (but leaving the script in place).

However, in Ubuntu, this has largely been replaced by Upstart which is a whole different way of doing things.

share|improve this answer

You may want to install the rcconf package for an easy way for you to enable/disable the service.

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.