git-http-backend with AuthzUnixGroup not working properly

天涯浪子 提交于 2019-12-04 11:17:08

This older answer

git-http-backend is returning a 403/Forbidden code when the client asks to use the git-receive-pack method.
It then falls back to WebDAV, but using WebDAV is not necessary.

I had the same problem; in my case this was due to REMOTE_USER not being set

Since any of my Apache config uses an '=' when setting a variable, check if this works better:

SetEnv REMOTE_USER $REDIRECT_REMOTE_USER

(no '-' between the two variables)

Check also if not (re)defining REMOTE_USER works too (because it might already been defined, while REDIRECT_REMOTE_USER might not): try without that line.
I never have to define it in my Apache Git config.

Note: with Git 2.21 (Q1 2019, 5+ years later), Git should be more robust.

I have been in situation like this, and found that trying to use Apache to serve git is anything but easy or simple.

Instead, I would recommend installing Gerrit - it allows to host multiple repositories, and most importantly has extremely flexible user/group management and permission model. As a nice bonus, it also happens to be very powerful code review engine, but it is completely optional - you don't have to use code review features if you don't want to.

Other known solutions for this are Gitlab and Gitolite - you might want to look into them as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!