Answer the question
In order to leave comments, you need to log in
How to properly organize rights and user groups on a web server with several people?
Good day!
I have such a problem, which for some reason was previously solved without any problems
. There are 3 users on the server - user, eagle, ws
User / Group on whose behalf php works - web
Each user can deploy to his test subdomain on the site.
deploy goes like this:
- a new folder is created
- The git clone
repository is executed in this folder
- shared directories are pulled up by Symlinks.
- Run custom tasks before launching
- On the current folder, which is root for nginx, put a symlink to a new folder.
So, the problem itself:
Git can only set 0644
rights or 0755
, the group will not be able to write, only the user himself, and the files havechown user:web
and сhmod 755
- after deployment.
The script crashes when you try to write something to a file, since php works from web:web
, and files user:web
I tried to make a custom task that adds the group the right to write to files, and insert it into the deploy chain.
But even here a problem crept in:
- the files that are created by the script (sessions, cache, logs) - they have chown web:web
and from under user I can’t change chmod to them, the task crashes.
Now user, eagle, ws
in a groupweb
Answer the question
In order to leave comments, you need to log in
put everyone in the same group or let the web change to indicate the group the developers are in - chgrp()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question