Nginx-to Enable Autostart

I installed the docker container in my ubuntu 13.10. Along with this nginx webserver also

installed.But every time i want to type this command

service nginx restart.

so how can i autorun the nginx?

1 Answer

Method 1: Start nginx at ubuntu startup

Check runlevel

^_^[root@easyengine:~]# runlevel 
N 2

My ubuntu runlevel is 2 so i'm edit the following file

mv /etc/rc2.d/K20nginx /etc/rc2.d/S20nginx

Now restart the system

Method 2: rc.local Add following line before the exit 0

service nginx start
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest