During SSD solid state drive optimization, /var/log was put into the ramdisk of tmpfs. Restarting caused the apache2 and nginx directories in /var/log to be lost, and apache2/nginx failed to start.
Solution: Create these two directories in ~/.bashrc and add them at the end of ~/.bashrc. (Oh, use the discovery method to add ~/.bashrc. After the second time you open the terminal, you will be prompted to create a directory error. It is better to add /etc/rc.local)
Tips-> Correction: Add the /etc/rc.local file before exit 0.
#for apache2
mkdir /var/log/apache2
#for nginx
mkdir /var/log/nginx
Restart the machine
Copyright statement: This article is an original article by the blogger and has not been authorized by the blogger. No reproduction allowed.
The above introduces the problem of installing lubuntu/ubuntu on SSD to optimize tmpfs, causing apache2/nginx to fail to start, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.