After PC reboot, apache2 fails to start cause of missing directory /var/log/apache2/. And php doesn't work because '/var/log/suphp/` folder missing too.
So after reboot /var/log/ refreshes or something like that. How i can solve this?
What patch, update i should install, and how to avoid this commands after each PC reboot:
sudo mkdir /var/log/suphp/ sudo mkdir /var/log/apache2/ Update:
It is fresh Ubuntu Trusty install.
$ ls -l /var/ total 36 drwxr-xr-x 2 root root 4096 лис 14 03:54 backups drwxr-xr-x 20 root root 4096 лис 13 23:52 cache drwxrwsrwt 2 root whoopsie 4096 лис 14 17:44 crash drwxr-xr-x 79 root root 4096 лис 14 18:32 lib drwxrwsr-x 2 root staff 4096 кві 11 2014 local lrwxrwxrwx 1 root root 9 лис 13 00:49 lock -> /run/lock drwxr-xr-x 7 root root 320 лис 17 08:21 log drwxrwsr-x 2 root mail 4096 лип 23 00:57 mail drwxrwsrwt 2 root whoopsie 4096 лип 23 01:22 metrics drwxr-xr-x 2 root root 4096 лип 23 00:57 opt lrwxrwxrwx 1 root root 4 лис 13 00:49 run -> /run drwxrwxrwt 4 root root 80 лис 17 08:12 spool drwxrwxrwt 2 root root 40 лис 17 08:22 tmp drwxr-xr-x 3 root root 4096 лис 13 23:37 www $ ls -l /var/log total 488 -rw-r--r-- 1 root root 216 лис 17 08:11 alternatives.log -rw-r--r-- 1 root root 5666 лис 17 08:11 boot.log drwxr-x--- 2 root lp 100 лис 17 08:12 cups -rw-r--r-- 1 root adm 59843 лис 17 08:11 dmesg -rw-r--r-- 1 root root 0 лис 17 08:11 dmesg.0 -rw-r--r-- 1 root root 910 лис 17 08:11 dpkg.log -rw-r--r-- 1 root root 1626 лис 17 08:11 gpu-manager.log drwx--x--x 2 root root 100 лис 17 08:11 lightdm -rw-r--r-- 1 root root 2141 лис 17 08:11 pm-powersave.log drwxr-xr-x 3 root root 160 лис 17 08:11 samba -rw-r--r-- 1 root root 358058 лис 17 08:11 udev -rw-r--r-- 1 root root 53242 лис 17 08:15 Xorg.0.log Apache2 restart output
$ sudo service apache2 restart [sudo] password for cosname: * Restarting web server apache2 [fail] * The apache2 configtest failed. Output of config test was: (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for main error log (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for error log of vhost defined at /opt/cosname/conf/apache2/virtual-hosts.conf:1 (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for error log of vhost defined at /etc/apache2/sites-enabled/000-default.conf:1 AH00014: Configuration check failed Action 'configtest' failed. The Apache error log may have more information. After sudo mkdir /var/log/apache2/ && sudo service apache2 restart
$ cat /var/log/apache2/error.log [Mon Nov 17 08:18:41.263776 2014] [mpm_prefork:notice] [pid 4483] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 configured -- resuming normal operations [Mon Nov 17 08:18:41.263845 2014] [core:notice] [pid 4483] AH00094: Command line: '/usr/sbin/apache2' [Mon Nov 17 08:18:45.027406 2014] [:error] [pid 4487] [client 127.0.0.1:49086] IOException in API_Linux_Logger.cpp:79: Could not open logfile /var/log/suphp/suphp.log [Mon Nov 17 08:18:45.027471 2014] [core:error] [pid 4487] [client 127.0.0.1:49086] End of script output before headers: index.php suPHP is enabled, and hasn't own log directory again after reboot. sudo mkdir /var/log/suphp/ solves it for current PC session