I am using Arch Linux on a web development machine, and have a multi-vhost setup with the root directories of each vhost under:
/var/www/vhosts
Apache2 is using the user/group: http/http
If I setup the files to be owned by my user and the http group then apache cannot access them. If I setup the files to be owned by http and the users group then I have no access.
I am trying to move from a Windows development machine to Linux since right now I am doing PHP MySQL work.
How can I get around this issue so that my user can create and edit files without needing to worry about breaking access for apache each time?
I use Arch as well quite a lot and instead like the approach of using a limited user’s home directory instead of /var/www/vhosts. For instance, you could have a user named sites, ensure that they’re not apart of any admin groups and then have the sites in /home/sites/site1, /home/sites/site2, etc… Then make sure that those directories are 644 and files 75: