Apache and git-http-backend

北城余情 提交于 2019-12-05 05:12:17

Is Apache's CGI module enabled? Try running sudo a2enmod cgi and then restarting Apache.

I had the exact same issue, which ended up being caused by the fact that the CGI module was disabled. In my case, the above command picked and enabled the "cgid" module.

I believe you need the trailing $1 if you're using ScriptAliasMatch, but should omit the $1 (but keep the trailing slash) if you're using ScriptAlias.

You may also need to add a Directory block that looks something like this:

<Directory "/usr/lib/git-core">
    Options +ExecCgi -MultiViews +SymLinksIfOwnerMatch
    AllowOverride none
    Order allow,deny
    Allow from all
    Require all granted
</Directory>

For other people running into similar problems with this specific error:

fatal: https://server/git/oswald.git/info/refs not valid: is this a git repository?

I eventually found what was causing this issue for me on CentOS 6.5: SELinux. Try running the following command:

setenforce 0

If that fixes your issue, then you have a permissions issue with ACLs. Granted, by running the above command, you've turned off a whole host of permissions checks, but it can at least tell you whether this is what's causing your problem. For more information, check out the documentation here.

Turn the checks back on by running

setenforce 1
Marmoy

I don't know if you solved it yet, but take a look at my answer here

I have a couple of ideas:

  • In my experience accessing the repository with https failed, while http worked.

  • You don't mention changing the repo directory owner to match the apache user, have you done that?

  • Have you confirmed that the git-http-backend script is located where you expect it to be?

Add this:

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