Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 am trying to explain some students what are the differences between having www on the home folder, for example /home/cyrex/www and in the /var/www. So I wanted to ask here what are the benefits of having it in the home folder instead of the default one.

share|improve this question
up vote 3 down vote accepted

Keeping web folders in user's home directory is good for 2 reasons mainly:

  1. If you have a web server with multiple users, keeping www folder in user's home directory will help you organizing, you can -as a administrator- easily know which user has what in her web folder.
  2. Second issue, well, actually the main issue is, security. By default Apache runs by a single user: www-data. However, if you have multiple web sites -owned by different users, let's say customers- running on a single server, and if you make www-data user own those web folders, users won't be able to make any modification in those folder via ssh, ftp, etc. Hence, to overcome this issue, you need to run apache with another user account for each user's web directory (apache-mpm-itk, suPHP and some other software helps you do this). In this case, keeping web folders of each user in user's home directory is the best. Because a user can do modifications on her own web directory connecting via ssh, ftp or any other method.
share|improve this answer

Honestly all I can think of is for a multi-customer server. FTP logins would go to their ~/ or ~/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.