Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 912  / 3 Years ago, fri, november 19, 2021, 10:37:43

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.


More From » apache2

 Answers
4

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.


[#35669] Saturday, November 20, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
olfdit

Total Points: 118
Total Questions: 98
Total Answers: 97

Location: Honduras
Member since Fri, Nov 25, 2022
1 Year ago
;