0

I'm currently trying to deploy Magento using git post-receive but I'm stuck on file permissions. There is the git and the www-data user - I'm guessing git needs write permission to write to /var/www/html/ but Magento suggests that www-data have permission set to 500 on most dirs and 400 on files.

How does one deal with such situation?

RS7
  • 2,341
  • 8
  • 34
  • 57
  • I asked about using git here http://stackoverflow.com/questions/14901679/how-to-use-git-locally-and-push-to-remote-server. One thing I recall was that you had to set the permissions on the post-receive file, which is described in one of the referenced links. – PedroKTFC Jul 15 '14 at 07:43

2 Answers2

0

Look into ACLs. getfacl and setfact.

File system ACLs allow you to have more fine grained system than standard UNIX-like u:g:o permissions allow.

user3427419
  • 1,769
  • 11
  • 15
  • And, unfortunately, they're a pretty huge pain to work with. You need to be careful with backups, with restores, permission inheritance can get messy, few (none?) of the standard tools that deal with permissions work anymore, ... – ChrisGPT was on strike Jul 15 '14 at 01:55
0

Don't use Magento suggestion and use permissions that you need(for example you can add user under which git runs to some special group that have write permissions to /var/www/html/). Also you can restrict permissions more specifically by using SELinux/ACL's/Whatever else.

You can't make git change files in this directory if there is no write permissions for that.

rufanov
  • 3,266
  • 1
  • 23
  • 41