Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to host the domains, and on my ubuntu Server using one IP address (ie vhosts) provided by my hosting.

What I could like to know is where to actually place the public files? Most guides recommend either /var/www/ or /home/ but they don't really explain why.

Is there a best practice for this situation?

share|improve this question
up vote 3 down vote accepted

Technically, you can place the files wherever you want.

The Unix/Linux filesystem layout standard (FHS) includes specific uses for where things go, based on the idea that certain directories could be mounted read-only, some intermittently available, some shared between systems with different CPUs, etc..

Based on the standard, /home is for user directories and programs shouldn't rely on it. /usr is read-only, and /var is for data that might change.

My recommendation: Use the directory your distribution uses. In the case of virtualhosts, directories underneath it. That ensures the least likelihood of causing a bad interaction with any other software on the system.

Ubuntu uses /var/www, so use /var/www/ Work with your Linux distribution, not against it.

share|improve this answer
I'll buy your reasoning. Answer accepted. Thanks! – Gestalter Nov 7 '09 at 18:28

The FHS indicates that /home should be for USER home directories. I would strongly recommend keeping sites that are not specific to a user in /var/www.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.