Linux FHS: /srv vs /var ... where do I put stuff?

Solution 1:

This stems from LSB which says "/var contains variable data files. This includes spool directories and files, administrative and logging data, and transient and temporary files." but says this for /srv: "/srv contains site-specific data which is served by this system."

SuSE was one of the first disto's that I used that kept webroot's in /srv - typically Debian/Ubuntu/RHEL use /var/www - but also be aware that if you install a web application using yum or apt then they will likely end up in /usr/share. Also the packaging guidelines for Fedora say that a "package, once installed and configured by a user, can use /srv as a location for data. The package simply must not do this out of the box".

On balanced reflection I would say keep to /var/www - or you can do both by making /var/www a symlink to /srv/www. I know that on oracle RDBMS systems that I build I often create /u01 /u02 etc as symlinks to /home/oracle. The reason for this is that many DBA's expect to find things in /u01 and many others expect /home/oracle. The same can be said of Sysadmins in general - some will instinctively look in /var/www and some in /srv/www while others like myself will grep the apache config for the DocumentRoot.

Hope this provides some guidance for you.