Git Gerrit在apache2后使用http克隆

Git Gerrit在apache2后使用http克隆,git,apache2,gerrit,Git,Apache2,Gerrit,我们安装了Gerrit来管理服务器上的存储库。 到目前为止,一切正常,我们可以使用ssh进行克隆 Gerrit是2.14.2版apache 2.4.18 这是我们的配置文件(需要时进行审查): /媒体/data/gerrit/etc/gerrit.config [gerrit] basePath = git serverId = ed5a7ef7-289e-4590-9292-cbdede1b0dc9 canonicalWebUrl = http://repository

我们安装了Gerrit来管理服务器上的存储库。 到目前为止,一切正常,我们可以使用ssh进行克隆

Gerrit是2.14.2版apache 2.4.18

这是我们的配置文件(需要时进行审查):

/媒体/data/gerrit/etc/gerrit.config

[gerrit]
    basePath = git
    serverId = ed5a7ef7-289e-4590-9292-cbdede1b0dc9
    canonicalWebUrl = http://repository.something.com/gerrit
[database]
    type = h2
    database = /media/data/gerrit/db/ReviewDB
[index]
    type = LUCENE
[auth]
    type = HTTP
    logoutUrl = http://logout@repository.something.com/gerrit
[receive]
    enableSignedPush = false
[sendemail]
    smtpServer = mail.something.com
    from = Code Review <review@gerrit.com>
[container]
    javaHome = /usr/lib/jvm/java-8-openjdk-amd64/jre
    user = administrator
[sshd]
    listenAddress = *:29418
[httpd]
    listenUrl = proxy-http://127.0.0.1:8081/gerrit
[cache]
    directory = cache
[plugins]
    allowRemoteAdmin = true
[download]
    command = checkout
    command = cherry_pick
    command = pull
    scheme = ssh
    scheme = http
[commitmessage]
    maxSubjectLength = 80
    maxLineLength = 100
    longLinesThreshold = 10
    rejectTooLong = false
[plugin "emoticons"]
    showEmoticons = true
[reviewers]
    enableREST = true
    enableUI = true
    ignoreDrafts = true
    autoAddReviewers = false
    maxReviewers = 1
    enableLoadBalancing = false
    plusTwoRequired = true
    plusTwoAge = 8
    plusTwoLimit = 10
[gitweb]
    type = custom
    linkname = log
    url = http://repository.something.com/cgit
    project = /${project}.git
    branch = /${project}.git/log
    revision = /${project}.git/commit/?id=${commit}
    filehistory = /${project}.git/log
[lfs]
    plugin = lfs
[gerrit]
basePath=git
服务器ID=ed5a7ef7-289e-4590-9292-CBDED1B0DC9
canonicalWebUrl=http://repository.something.com/gerrit
[数据库]
类型=h2
数据库=/media/data/gerrit/db/ReviewDB
[索引]
类型=LUCENE
[授权]
类型=HTTP
注销URL=http://logout@repository.something.com/gerrit
[接收]
enableSignedPush=false
[发送电子邮件]
smtpServer=mail.something.com
from=代码审查
[货柜]
javaHome=/usr/lib/jvm/java-8-openjdk-amd64/jre
用户=管理员
[食环署]
listenAddress=*:29418
[httpd]
listenUrl=代理-http://127.0.0.1:8081/gerrit
[缓存]
目录=缓存
[插件]
allowRemoteAdmin=true
[下载]
命令=签出
command=cherry\u pick
命令=拉动
scheme=ssh
scheme=http
[提交信息]
maxSubjectLength=80
maxLineLength=100
longLinesThreshold=10
拒绝工具长=假
[插件“表情符号”]
showEmoticons=true
[评论员]
enableREST=true
enableUI=true
ignoreDrafts=true
autoAddReviewers=false
maxReviewers=1
enableLoadBalancing=false
plusTwoRequired=true
plusTwoAge=8
plusTwoLimit=10
[gitweb]
类型=自定义
linkname=log
url=http://repository.something.com/cgit
project=/${project}.git
branch=/${project}.git/log
revision=/${project}.git/commit/?id=${commit}
filehistory=/${project}.git/log
[lfs]
plugin=lfs
/etc/apache2/mods enable/gerrit.conf

ProxyPassMatch /([[:alnum:]-]+)\.git(.*) http://localhost:8081/gerrit/a/$1.git$2
ProxyPass           /gerrit  http://localhost:8081/gerrit nocanon
ProxyPassReverse    /gerrit  http://localhost:8081/gerrit nocanon
ProxyRequests       Off

<Proxy http://localhost:8081/gerrit>
  Order deny,allow
  Allow from all
</Proxy>

<Location /gerrit>
  AuthType Digest
  AuthName "gerrit"
  AuthUserFile /etc/apache2/.htdigest
  Require valid-user
</Location>
ProxyPassMatch/([[:alnum:]-]+)\.git(.*)http://localhost:8081/gerrit/a/1美元。吉特2美元
ProxyPass/gerrithttp://localhost:8081/gerrit 诺卡农
ProxyPassReverse/gerrithttp://localhost:8081/gerrit 诺卡农
代理请求关闭
命令拒绝,允许
通融
AuthType摘要
AuthName“gerrit”
AuthUserFile/etc/apache2/.htdigest
需要有效用户
正如我所说,使用ssh进行克隆效果很好。但是,当尝试使用http进行克隆时,会出现身份验证错误。 我在启用mods的单独配置文件中尝试了很多不同的设置,也在可用的站点中

你知道会出什么问题吗

如前所述,我们在repository.someting.com上有一个登录页,并使用repository.something.com/Gerrit访问Gerrit


所有这些apache配置的东西对我来说都是全新的-所以我不知道我实际上在做什么^^ ^

为了获取更多信息,我将apache日志级别更改为debug

这是我的尝试:

  • 在global.gitconfig中使用TortoiseGit进行克隆,无需任何修改

    AH01781:客户端使用了错误的身份验证方案'Basic':/gerrit/a/pluginter/info/refs

  • 使用GitBash克隆,而不在global.gitconfig中进行任何修改

    AH01794:用户hanswurst:密码不匹配:/gerrit/a/pluginter/info/refs

  • 我将http.proxyAuthMethod=digest添加到.gitconfig中,并用TortoiseGit重试

    AH01781:客户端使用了错误的身份验证方案'Basic':/gerrit/a/pluginter/info/refs

  • 还尝试了Git Bash

    AH01794:用户blubb:密码不匹配:/gerrit/a/pluginter/info/refs

  • 我在文档中读到,这只在使用带有用户名的代理时有效;所以我添加了http.proxy=并再次尝试使用Ortoisegit

    AH02422:HTTP请求行;URI不能包含用户名/密码

  • 还有GitBash

    AH02422:HTTP请求行;URI不能包含用户名/密码

  • 即使文档中说代理必须包含用户名, 我还尝试了http.proxy上的代理= 现在是乌龟

    AH01781:客户端使用了错误的身份验证方案'Basic':/gerrit/a/pluginter/info/refs

  • 还有GitBash

    • AH01626:需要有效用户的授权结果:拒绝(尚未验证用户)
    • AH01626:的授权结果:拒绝(尚未验证用户)
    • AH01626:需要有效用户的授权结果:已授予
    • AH01626:授权结果:已授予
    • AH01143:正在运行方案http处理程序(尝试0)
    • AH00942:HTTP:已获取(本地主机)的连接 正在连接到本地主机:8081 已连接/gerrit/a/pluginester/info/refs?service=git上传包到本地主机:8081
    • AH00943:http:已释放(本地主机)的连接
  • 第7点是我所期望的,因为该摘要将不再使用。
    但是在8号。在服务器上,这对我来说很好,但是客户端仍然得到“身份验证失败”

    我将apache日志级别更改为debug以获取更多信息

    这是我的尝试:

  • 在global.gitconfig中使用TortoiseGit进行克隆,无需任何修改

    AH01781:客户端使用了错误的身份验证方案'Basic':/gerrit/a/pluginter/info/refs

  • 使用GitBash克隆,而不在global.gitconfig中进行任何修改

    AH01794:用户hanswurst:密码不匹配:/gerrit/a/pluginter/info/refs

  • 我将http.proxyAuthMethod=digest添加到.gitconfig中,并用TortoiseGit重试

    AH01781:客户端使用了错误的身份验证方案'Basic':/gerrit/a/pluginter/info/refs

  • 还尝试了Git Bash

    AH01794:用户blubb:密码不匹配:/gerrit/a/pluginter/info/refs

  • 我在文档中读到,这只在使用带有用户名的代理时有效;所以我添加了http.proxy=并再次尝试使用Ortoisegit

    AH02422:HTTP请求行;URI不能包含用户名/密码

  • 还有GitBash

    AH02422:HTTP请求行