Linode has been upgraded again~ But because the old machine in the Japanese computer room will take a few weeks to upgrade, I can't wait, so I opened a new machine, planning to move home, and by the way, sweep away the unnecessary garbage on the server.
The new machine uses the lnmp one-click installation script I wrote myself (in fact, most of the code is found online = =##), and after making the script on DigitalOcean, I put it on Linode to install. There was no problem with installation and moving, but as soon as it was restarted after installation, there was a problem.
After restarting, it stands to reason that Nginx should start automatically, but after waiting for a long time, the website still cannot be accessed. Log in to SSH and execute:
service nginx start
Launch Nginx manually, and the website will be accessible in no time. The self-starting script is fine, and there is no problem with manual starting, why does nginx just not start?
Looking through the logs, I found a line like this:
2014/05/02 17:02:28 [emerg] 2912#0: bind() to [2400:8900::f03c:91ff:fe6e:5889]:80 failed (99: Cannot assign requested address)
It feels like when starting Nginx, ipv6 has not been initialized, so the startup failed. When I log in to SSH and manually start Nginx, ipv6 has already been initialized, so it can start normally.
Probably guessed the reason, how to solve it? After a long day of Google, I found a similar problem and solution on ServerFault, and I will record it here.
Insert in /etc/sysctl.conf:
- sysctl -w net.ipv6.conf.eth0.dad_transmits=0
Copy code Or:
Add a line in /etc/network/interfaces:
- post-up while ip -6 addr show tentative | grep . > /dev/null ; do sleep 1 ; done
Copy code I use the latter method to solve the problem.
|