In general, if we have installed the LNMP one click package on the VPS and server, the supporting software will start automatically whether it is restarted or not, including Nginx. But I met a friend's message, saying that after he restarted the server when installing the LNMP military brother's one click package, the website and database could not be connected. When he restarted Nginx, Lao Zuo found that the current Nginx was closed.
It seems that every time after restart, Nginx is not started after shutdown. In view of this problem, we can add the Nginx restart item to the boot file.
echo "/etc/init.d/nginx start " >>/etc/rc.local
After executing the command and adding it to the configuration file/etc/rc.local, we can restart and see that Nginx can start automatically and normally.
Scan the code to follow the official account
Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge