3

I have just seen the /var/ directory being defined as:

Multi-purpose log, temporary, transient, and spool files. A memory-based file system is sometimes mounted at /var. 

Whereas /usr/ has been described as:

The majority of user utilities and applications.

and /usr/share/ is:

Architecture-independent files.

To my eye, it looks like web apps I write fall under "user utilities and applications" (but this is a server, so storing this stuff under my home directory is impractical if I want other admins to work on it). My web apps have nothing to do with the 'system architecture'.

Hence, /usr/share/www/ looks like a great place to store web apps and serve from, as opposed to /var/www/. I am aware apache server's convention is to store in /var/, but I'm using a different server and even if I was using apache, I don't mind stepping on this particular convention's toes.

My question is, any compelling arguments against using this directory?

5
  • 1
    You might also want to read the manual page hier(7). FWITW, on my server I use a separate partition mounted on /www/ instead of /var/www/.
    – Lekensteyn
    Oct 26, 2013 at 21:26
  • Oh, that is a pretty awesome man page @Lekensteyn, thanks for pointing out! /usr/local/ seems to have many conventions already set up for this purpose.
    – Aditya M P
    Oct 26, 2013 at 21:28
  • Yeah, /www/ (separately mounted if possible) seems like the very best option...
    – Aditya M P
    Oct 26, 2013 at 21:29
  • I was also suggested that /opt/ is a good candidate, and the description on Wikipedia for this directory sounds great as well! Ah... so many choices :)
    – Aditya M P
    Oct 26, 2013 at 21:30
  • 1
    I think you are reading too much into those description of the linux file system. at any rate, you may configure your web server to use any directory you wish. /var/www/ is the default, but config as you wish
    – Panther
    Oct 26, 2013 at 23:39

1 Answer 1

3

There's nothing forcing you to use either. You can define where you want your files to live. Some people move them under their user accounts, some people create a /srv/ directory... I've created a /websites/ directory.

/var/www/ is just a convention. You don't have to follow it.

Edit: /srv/ is actually a convention too, just not one Debian/Ubuntu follows currently.

Not the answer you're looking for? Browse other questions tagged .