.. title: Should Web Apps Go in /srv or /var/www? .. slug: should-web-apps-go-in-srv-or-var-www .. date: 2015-04-08 04:43:02 UTC .. tags: debian, fhs, freebsd, nginx, http, www .. category: .. link: .. description: .. type: text Should Web Apps Go in /srv or /var/www? ============================================== Is it better to follow Debian's default webroot policy or FHS? Should I install my web apps in */srv* or */var/www*? .. TEASER_END: Read more nginx and Apache in Debian and Ubuntu use */var/www* as the default webroot. Arch Linux, on the other hand, uses */srv/http*. nginx in FreeBSD uses */usr/local/www/nginx* as default webroot. The `purpose of */srv* `_, according to the Filesystem Hierarchy Standard, is:: This main purpose of specifying this is so that users may find the location of the data files for particular service, and so that services which require a single tree for readonly data, writable data and scripts (such as cgi scripts) can be reasonably placed. Data that is only of interest to a specific user should go in that users' home directory. My Answer -------------------------------- I install web apps to */srv/www* and configure httpd (nginx or Apache2) to use that path for primarily these two reasons: * Install web apps out of the webroot for security reasons. * The purpose of */srv*'s existence. Another problem was whether to use */srv/www* or */srv/http*? I'm in the *www* camp because the greater Debian ecosystem prefers it to *http* (see: www-data user and group). Read More -------------------------------- * `FHS and /var/www `_ * `Archlinux /srv/http vs Debian /var/www `_