What you can do is set the sticky bit group bit ( SetGID ) in the directory that CGI works with:
chgrp mygroup dir chmod g+s dir
Make sure that when executing this (apache) user (apache) is in the mygroup group (in /etc/group ), so he will have permissions.
This will make sure that any file created in this directory belongs to the same group as the directory.
This is a safer approach than installing a global umask for EVERY cgi script that apache can run.
(This is how git-http-backend starts from Apache as usual).
Brad Apr 18 '17 at 12:39 on 2017-04-18 00:39
source share