Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to host the domains example.com, example.org and example.net 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/example.com or /home/example.com but they don't really explain why.

Is there a best practice for this situation?

share|improve this question
add comment

2 Answers

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/example.com. 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
add comment

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
add comment

Your Answer

 
discard

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