Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

closed as primarily opinion-based by Lekensteyn, Braiam, LiveWireBT, Warren Hill, Eric Carvalho Oct 27 '13 at 12:09

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

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 '13 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 menon Oct 26 '13 at 21:28
    
Yeah, /www/ (separately mounted if possible) seems like the very best option... –  aditya menon Oct 26 '13 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 menon Oct 26 '13 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 –  bodhi.zazen Oct 26 '13 at 23:39

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.