Question
Best way to set ownership of web root
I’ve created a droplet, but the owner and group is root.
In other set-ups, I’ve seen the web root have user and group of something like www-data or apache.
How do I emulate this set-up so I can read and write files to my web root without needing to run commands as sudo?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
Mr Bean.
It really depends on what you are attempting to do..
If you are wanting to make it so you can write/edit with your regular user you should check out:
https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts
OK, so I’ve added my UNIX user (
code
martin) to thewww-data
group. However, now when I try to clone my project’s source code into the directory (that is now owned by thewww-data
user and group) I get the following error:What’s failing now? Does Git use a different user, even though it’s my account (
martin
) issuing the command?