Frequently Asked Question

What is /srv and how is it different from /var/www?

/srv is the FHS's designated location for site-specific data served by this system: a web server's document root might be /srv/www, an FTP server's files /srv/ftp, a Git repository host's storage /srv/git. The idea is that an administrator looking at any Linux server should immediately know where to find the data the machine is serving, no matter which distribution it runs, and that this data is logically separate from configuration (/etc), program state (/var/lib), and logs (/var/log).

In practice, the convention is patchily applied. Debian and Ubuntu's Apache packages default to /var/www/html for the document root because that location predates the FHS's adoption of /srv in 2.3 (2004), and millions of tutorials still reference it. Modern distributions and bespoke deployments often do use /srv, Arch's web servers default there, as do most internally-managed corporate setups. Either is FHS-compliant; pick one and document it.

Video

Further reading and video