2

I know it's not the first question on that subject but my purpose is slightly more specific.

I've read many discussions about it and what I understand is that semantically, according to FHS, websites should be kept in /srv directory. What I do not understand is why Apache is using /var as default directory and why still most people use it.

I'm perfectionist and it's really bugging me that I could have something on my server which isn't... well, perfect (I literally couldn't sleep tonight because of this...).

Basically what I want to know is if there is any practical difference between storing websites in /var and in /srv. I have my VPS for three days now and before that my experience with Linux and servers was really small so there are probably things I can't even imagine now that can cause problems in future. I guess if there are so many people using /var there must be better reason than many people do this so I will do this as well.

sajran
  • 61
  • 1
  • 5
  • `/var`, `/srv`, `/baconandeggs`, it's all the same to Apache. It's only us silly people who care what things are called. Put things wherever you feel is best and move on. – GregL Apr 28 '16 at 11:49
  • Why this question is CLOSED because of OPINION-BASED? `/var` contains variable data files. This includes spool directories and files, administrative and logging data, and transient and temporary files. The reason why Apache uses `/var` as a placeholder is that `/srv` directory is yours. Apache should never touch your server directory. – Dita Aji Pratama May 08 '22 at 13:34

1 Answers1

3

/var is simply the default and most people stick with default in everything they do. If it is a simple site, then there is little reason to change it. I manage a very complex web application and found it useful to move it to /srv so that it is isolated from other stuff. This is really more for my convenience and to protect myself from my own carelessness than anything.

But technically speaking, it does not really matter where you put it.

Alex
  • 168
  • 1
  • 1
  • 7