Webmasters Stack Exchange is a question and answer site for pro webmasters. 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've been creating new directories for each site in the var folder like this:

  • /var/www -- localhost -- owned by localuser:www-data (+setuid/setguid)
  • /var/www-somesite -- somesite.com, somesiteuser:somesitegroup (+setuid/setguid)
  • /var/www-anothersite -- anothersite.org, anothersiteuser:anothersitegroup (+setuid/setguid)

A virtual host points is associated to each of these directories. The apache user www-data is a member of somesitegroup and anothersitegroup

Is there a better practice I should be following for this?

share|improve this question

migrated from stackoverflow.com Sep 15 '11 at 6:43

This question came from our site for professional and enthusiast programmers.

up vote 2 down vote accepted

If you have multiple users with different websites on your server, it's commonplace to place the user's website in a directory within their home folder and use the Apache configuration to point the relevant domain name at the appropriate directory.


The has the added benefit of allowing for ease of limiting user disk quota and removing their files when you remove the user. It also keeps your default web root clean and makes it easier to run your default website out of /var/www.

share|improve this answer

Your Answer


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

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