I'm running a web server that uses PHP5 and SQlite for database queries. I have my crontab set to reboot the machine at midnight each day.
Every few days, all of my files in the /var/www folder are gone along with the folder itself. Apache2 gives me a 404 error. When I restart Apache2, it fails because the /var/log/apache2 folder is deleted.
How can I stop this?
tail: cannot open '/var/logs/syslog' for reading: No such file or directory– Elliot A. Apr 23 '17 at 12:54/var/log/..., not/var/logs. I'm not sure how much help it will really be, but it is something you should get comfortable sifting through anyway so Elliot might as well start now. On Raspbian 8 (jessie) there is also the similarjournalctl -x(seeman journalctl). – goldilocks Apr 23 '17 at 14:05-xisn't terribly useful withjournalctl, but otherwise it's generally a better program to use than grovelling in log files on Debian 8 because, unless you ask it otherwise, it displays all log entries. Just remember, you need to be root when you run it to see all log entries. – cjs Apr 23 '17 at 15:41Control will enter here if $DIRECTORY doesn't exist.
fi Also, maybe a permissions/owner change to stop it being deleted but I wouldn't change anything until I figure out what's going on.
– MartinMarty Apr 23 '17 at 19:55sudo grep -rnH '/var/www' /etc
I was surprised to see that /var/www is the home directory for userid www-data. Is there any chance that userid is being deleted or recreated about the time the files go away?
– Chad Farmer May 02 '17 at 05:24