Question
How to set up nginx in ubuntu droplet
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×I get that message when I restart the droplet.
The reason being - nginx comes up before lighttpd. (If you know how to change the order of what service get’s started first - drop me a line. tnx)
Trying to start lighttpd fails:
can't bind to port: 80 Address already in use
Solution:
service nginx stop
service lighttpd start
service nginx start
Regarding changing the order of startup scripts:
If you look at /etc/rc2.d (runlevel 2 is the default runlevel for ubuntu), you will see a number of files linked back to files in /etc/init.d.
Scripts that start with S are startup scripts.
The next 2 digits indicate the order that the script is executed in that directory (the lower the number, the earlier the execution).
By me - I had the following setting:
S20nginx
S91lighttpd
Doing the following solved the issue:
mv S20nginx S95nginx