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

2 Answers 2

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

Honestly all I can think of is for a multi-customer server. FTP logins would go to their ~/ or ~/www/.

share|improve this answer
add comment

Your Answer

 
discard

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.