LAMP server newbie here:
I have a web server (on a VPS that I have full root access to), in which I'm setting up a few users with websites for.
I have apache2 and php set up, and I have manually specified a few sites for them under the /etc/apache2/sites-enables directory (symlinking them from sites-available, as per normal).
I don't actually use the /var/www/ directory, instead opting for the following sort of set up:
/home/user1/www/websiteone.com/
/home/user1/www/subdomain.websiteone.com/
/home/user1/www/differentwebsiteone.com/
/home/user2/www/websitetwo.com/
/home/user3/www/websitethree.com/
etc, etc, etc. I hope you can see where I'm getting at.
I have two issues though:
Apache cannot write to these directories. Is there a simple, clear explanation on how I can achieve this for all /home/*/www/ directories ONLY (and recursively) to be writable by www-data, without giving user1 write access to user2 and so on? A simple step that retroactively works on all future users is preferred, but I don't mind manually setting it up should it be impossible.
Secondly: In some cases, I would like, say, user2 to have access to the differentwebsiteone.com files (in user1's home directory), but not give them access to anything else (so, some sort of symlink appears as /home/user2/www/differentwebsiteone.com). Can I achieve this easily? Maybe moving the site files to /var/www/ and symlinking to their respective home directories? Or something? Advice is much appreciated!
Thanks!