Glossary

/srv

/srv is a relatively new addition to the FHS, introduced to provide a standard location for data served by the system—for example, the document roots of a web server, the files shared over FTP or Samba, or the repository of a git server. The idea is to give administrators a single, predictable place for service data that is cleanly separated from the software serving it.

In practice, /srv is used inconsistently. Debian-based systems encourage it (/srv/www/, /srv/ftp/), while Red Hat-based systems tend to keep web roots under /var/www/ instead. Many administrators ignore it altogether and put data wherever is convenient. The standard does not mandate internal structure: you might see /srv/http/, /srv/samba/, or just /srv/<hostname>/.

The value of /srv is mainly organisational. Putting service data under /srv makes it easy to back up, easy to move to a separate partition or network filesystem, and easy to find when a new administrator takes over. It also cleanly separates "data this machine serves" from "data this machine uses", which aids reasoning about disaster recovery and access control.

Related terms: Filesystem Hierarchy Standard, /var

Discussed in:

Also defined in: Textbook of Linux