如何解决gerrit遇到的安装问题系列

已经快搞定了感觉胜利的曙光来了,先记录一下,怕以后忘记了这些坑

1.500错误,并且error log显示如下
No protocol handler was valid for the URL /gerrit. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
解决办法:
a2enmod proxy_http
2.报错[2017-04-07 12:03:44,200] [HTTP-33] ERROR com.google.gerrit.httpd.auth.container.HttpLoginServlet : Unable to authenticate user byAuthorization request header.  Check container or server configuration

网页显示错误如下:

Configuration Error

Check the HTTP server's authentication settings.

The HTTP server did not provide the username in the Authorization header when it forwarded the request to Gerrit Code Review.

If the HTTP server is Apache HTTPd, check the proxy configuration includes an authorization directive with the proper location, ensuring it ends with '/':

如何解决?说实话,我没有找到问题的根源,只是这样解决出一个问题,解决一个问题,那样解决出一个问题,结果,我忘记怎么解决的了,问题的根源没有记录下来.

比较重要的是看gerrit和apache的log,出什么问题解决什么问题.

所以存下了配置,用作参考.

顺便说一下,我安装的gerrit2.12+apache2


vim /etc/apache2/httpd.conf

<VirtualHost [My_IP]:80>
    ServerName [My_IP]

    ProxyRequests Off
    ProxyVia Off
    ProxyPreserveHost On
    <Proxy *:80>
          Order deny,allow
          Allow from all
    </Proxy>
    <Location '/login/'>
      AuthType Basic
      AuthName "YuhuiXU Gerrit Code Review"
      Require valid-user
      AuthBasicProvider file
      AuthUserFile  /usr/local/gerrit/etc/passwds
    </Location>
    AllowEncodedSlashes On
    ProxyPass / http://[My_IP]:8081/
</VirtualHost>

vim /usr/local/gerrit/etc/gerrit.config

[gerrit]
    basePath = git
    canonicalWebUrl = http://test026:80/
[database]
    type = mysql
    hostname = localhost
    database = reviewdb
    username = gerrit
[index]
    type = LUCENE
[auth]
    type = HTTP
[receive]
    enableSignedPush = false
[sendemail]
    smtpServer = localhost
[container]
    user = root
    javaHome = /usr/lib/jvm/java-8-openjdk-amd64/jre
[sshd]
    listenAddress = *:29418
[httpd]
    listenUrl = http://[My_IP]:8081/
[cache]
    directory = cache


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值