apache2: Cannot access directory '/var/log/apache2/' for main error log


I have a couple of apache2 servers in my Leap 42.1 machine and for some months they have simply failed to light up when I boot in the morning. the error message from the diagnostic command “systemctl -l status apache2.service” is essentially this:

Cannot access directory '/var/log/apache2/' for main error log

I find that I have to re-create the directory apache2 in location /var/log, and then restart apache2 server to get the lights on again.

I notice that fstab has these lines in it (amongst other stuff):

tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0

I don’t understand why. It’s obviously part of the problem. Puzzled. Anyway, I finally worked it around by putting these two lines in the boot.local file at location /etc/init.d/boot.local:

mkdir /var/log
mkdir /var/log/apache2

Presumably because /var/log directory comes and goes. My rough fix shouldn’t be necessary in a Leap installation. Can someone explain why this is happening? And what should be done to fix it properly?


Well it is a tmpfs thus not real but exists only in memory. What file system?? Don’t know why the do not mount :\

I think it was installed when I put Leap on an SSD. That explains it all, I had quite forgotten doing that such a long time ago.