客户端在尝试使用 git-http-backend.exe 时被服务器配置拒绝

Posted

技术标签:

【中文标题】客户端在尝试使用 git-http-backend.exe 时被服务器配置拒绝【英文标题】:Client denied by server configuration while trying to use git-http-backend.exe 【发布时间】:2012-09-27 09:54:23 【问题描述】:

我使用 apache 2.4

Sat Oct 06 15:25:47.948789 2012] [authz_core:error] [pid 7580:tid 1232] [client 192.168.100.252:10153] AH01630: client denied by server configuration: C:/Program Files (x86)/Git/libexec/git-core/git-http-backend.exe

这是我的配置

<Directory "C:\git-server">
Options +ExecCGI
Allow from all
</Directory>

 <VirtualHost *:80>
  DocumentRoot  "C:/git-server"
   ServerName ****
  DirectoryIndex index.php

SetEnv GIT_PROJECT_ROOT c:/git-server
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
ScriptAlias /git/ "C:/Program Files (x86)/Git/libexec/git-core/git-http-backend.exe/$1"


<LocationMatch "^/.*/git-receive-pack$">
Options +ExecCGI
AuthType Basic
AuthName intranet
AuthUserFile "C:/git-server/config/users"
Require valid-user
</LocationMatch>

<LocationMatch "^/.*/git-upload-pack$">
Options +ExecCGI
AuthType Basic
AuthName intranet
AuthUserFile "C:/git-server/config/users"
Require valid-user
</LocationMatch>


</VirtualHost>

我正在尝试 2 天来设置 git。没想到这么难。

【问题讨论】:

【参考方案1】:

您应该更改配置以满足 Apache 2.4 的需求:

<Directory "C:\git-server">
Options +ExecCGI
Require all granted
</Directory>

来源:http://httpd.apache.org/docs/2.4/upgrading.html#access

【讨论】:

虽然很奇怪。文档(链接)声明有一个兼容的模块 access_compat.load 但即使启用此功能,您仍然需要修改目录语句。 (至少在我的情况下。)否则它不会工作! 我关注了this tutorial,它注意到了 2.4 之前的方式;您的回答,以及关于将 libiconv-2.dll 从that tutorial 复制到 git-core 的评论让我的设置可以使用了。 这对我没有帮助(我也在 Linux 下)。相反,我必须使用 &lt;Files&gt; 和可执行文件的路径,而不是 HTTP (GIT) 数据的路径。

以上是关于客户端在尝试使用 git-http-backend.exe 时被服务器配置拒绝的主要内容,如果未能解决你的问题,请参考以下文章

带有 AuthzUnixGroup 的 git-http-backend 无法正常工作

再谈git的http服务

再谈git的http服务-权限控制hooks版

再谈git的http服务-权限控制gitweb版(未成功)

尝试在 AWS S3 上使用客户端 API 初始化 Datomic Cloud 时出现“无法读取密钥文件”错误

尝试使用 Ktor/Java8 读取在 App Engine Standard 上运行的数据时,Firestore 客户端挂起