This is just for my own curiosity. Isn't the purpose of the var directory to hold files that the system writes? For example: logs, cache, lock, etc.
I understand that you can direct apache to point to anywhere by modifying the configuration files, but I just don't understand why the default location would be /var/www.
/var/
is for
Variable files —- files whose content is expected to continually change during normal operation of the system —- such as logs, spool files, and temporary e-mail files. Sometimes a separate partition.
-- Wikipedia
thus not necessarily things that the system writes. I agree that www
is a bit of an odd duck - it is not supposed to be all that variable. Some distros have it under /usr/share
, some in other places - /var/www
is not universally acknowledged. Actually, according to the FHS, the www data should be under /srv
, but few systems I encountered seem to adhere to that.
I was curious too, so I dug through some old mailing list posts. It looks like part of the motivation was that /var
is most likely kept on a read-write file system or device, whereas other parts of the system might be read-only (CD, etc). As someone else said /var
is for variable files so by definition it shouldn't be read-only.
Apache don't have control over how an installation is configured by default, that's more down to the linux distribution developers. Looking at some Debian discussions about /srv/www
the responses seem to be "just leave it as it is".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With