I have the following directories, where /data
is the mount point for a data partition, and /var
is a symlink:
lrwxrwxrwx 1 root root 9 Nov 20 13:25 /var -> /data/var
lrwxrwxrwx 1 root root 9 Nov 20 23:41 /var/lock -> /run/lock
drwxr-xr-x 5 root root 4096 Nov 20 13:42 /data
drwxr-xr-x 12 root root 4096 Nov 21 01:44 /data/var
drwxr-xr-x 6 root root 4096 Dec 18 06:25 /data/var/log
drwxr-x--- 3 root adm 4096 Dec 8 06:25 /data/var/log/apache2/
Apache seems to have issues with this approach:
mktemp: failed to create directory via template '/var/lock/apache2.XXXXXXXXXX': No such file or directory
I solved that by changing /etc/apache2/envvars
to refer to /run/lock
directly, but the next error wasn't solved by changing APACHE_LOG_DIR
in envvars
:
(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 /etc/apache2/sites-enabled/site.conf:2
AH00014: Configuration check failed
How can I make this work?