1

I have a fresh up-to-date Ubuntu Server 24.04.1 LTS install and have installed a LAMP stack to create and serve some PHP websites. I have created separate directories for each of the sites (site1, site2, etc.) under the /var/www/ directory.

What I would like to do is have multiple users (a separate group?) per site able to access and write files from VS Code (using remote development over SSH extension), whilst maintaining access for Apache and being as secure as possible.

Assuming MyUser, Site1_UserA, Site1_UserB need access to Site1, and MyUser, Site2_UserA need access to Site2. How should I set up permissions on the relevant 'site' directories?

I have done a fair bit of searching and reading up, but there are a lot of different methods suggested for multi-site access. Note. I am not really looking to implement user_dirs, as there may be several overlaps of users to each site - so I think it would be best to stick to serving from /var/www/.

Update:
@muru's suggestion seems promising, but it is not clear to me how this can be used to give permission to my "site" groups whilst I presume I need to maintain group permissions for www-data (apologies, coming from Windows, I find Unix groups and permissions a little confusing) - more reading up needed.

Craig
  • 1,346

0 Answers0