最近在学习gerrit+apache2的搭建,它俩都搭建完了,访问的时候出现了些问题

liao_hb 2015-07-07 10:56:30
gerrit.config如下:
[gerrit]
basePath = git
canonicalWebUrl = http://192.168.253.5:8081/gerrit/
[database]
type = h2
database = db/ReviewDB
[auth]
type = HTTP
[sendemail]
smtpServer = localhost
[container]
user = gerrit
javaHome = /usr/java/jdk1.7.0_79/jre
[sshd]
listenAddress = *:29418
[httpd]
listenUrl = proxy-http://127.0.0.1:8081/gerrit/
[cache]
directory = cache



apache的httpd.conf如下:
<VirtualHost *>
ProxyRequests Off
ProxyVia Off
ProxyPreserveHost On

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

<Location "/gerrit/login/">
AuthType Basic
AuthName "Gerrit Code Review"
AuthBasicProvider file
AuthUserFile /home/gerrit/review_site/etc/gerrit.passwd
Require valid-user
</Location>

AllowEncodedSlashes On

RedirectMatch ^/gerrit$ /gerrit/
ProxyPass /gerrit/ http://127.0.0.1:8081/gerrit/
ProxyPassReverse /gerrit/ http://127.0.0.1:8081/gerrit/
</VirtualHost>



访问127.0.0.1:80结果返回如下:
It Works!

访问127.0.0.1:8081/gerrit结果返回如下:

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 '/':

<VirtualHost 127.0.0.1:8081>
ServerName 127.0.0.1

ProxyRequests Off
ProxyVia Off
ProxyPreserveHost On

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

<Location /gerrit/login/>
AuthType Basic
AuthName "Gerrit Code Review"
Require valid-user
...
</Location>


AllowEncodedSlashes On
ProxyPass /gerrit/ http://.../gerrit/ nodecode
</VirtualHost>



上面的问题怎么解决,多谢了,遇到过的帮忙解决下,*_*,会不吝感谢的。
...全文
786 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
C546465 2016-06-13
  • 打赏
  • 举报
回复
刚刚也遇到这个问题,几年之前有人在google的“Repo and Gerrit Discussion ()“ 上提出过这个问题,回复是由于mysql数据库的不匹配导致的,具体如下: http://permalink.gmane.org/gmane.comp.version-control.repo/14363 根据google的标准的安装步骤,需要注意如下: (1) mysql中gerrit2帐号和密码是否存在且匹配,这个可以通过在mysql中用sql语句来解决; mysql>update mysql.user set password=password('你的密码') where user='gerrit2'; mysql>flush privileges; 其实这个帐号和密码在google的安装说明中已经说明了,只是部署系SQL语句的人容易忽略直接照抄了 “CREATE USER ‘gerrit2’@‘localhost' IDENTIFIED BY 'gerrit2' ” 其中IDENTIFIED BY后面的单引号中的就是你的mysql帐号gerrit@localhost的密码; (2)reviewdb是否存在,要注意,名字要和安装gerrit war包时的设置保持一致,如果不确定,建议再用war包更新一遍; (3)还需要确认一下git 数据仓库的读写权限,gerrit2帐号是否能够读写git数据仓库(这个还没验证); 把MYSQL调整好之后,这个500的问题基本上就可以解决了; 如果还是有500的问题,则可能来自于其他方面,建议仔细分析一下gerrit安装路径下的“log/error_log“文件,看一下为什么会有这个问题了。
  • 打赏
  • 举报
回复
求解,也遇到同样的问题
liao_hb 2015-08-01
  • 打赏
  • 举报
回复
我回来了,看到了自己提过的问题。搂住还没有解决。不过可以肯定地是apache的反向代理和http-basic都是正确的,只是gerrit这边的出了问题,安装了好多次,现在的问题是访问页面报这个了,HTTP ERROR: 500 Problem accessing /login/. Reason: Missing project All-Projects。 唉。。。那位遇到的解决了的好心人,可以帮帮我们这群蛮横逞强的饥渴脑袋。
pudia 2015-07-23
  • 打赏
  • 举报
回复
楼主,问题解决了吗?我也是同样的报错,ubuntu14.04,各种换端口,搞了两天还没搞定,郁闷。望不吝赐教,q214480453,谢谢
skywolfpk 2015-07-14
  • 打赏
  • 举报
回复
楼主解决了吗?我用的nginx,不过是同样的问题
skywolfpk 2015-07-14
  • 打赏
  • 举报
回复
看到有人提同样的问题,我很开心,不过看到最后才发现没有人解答。
liao_hb 2015-07-08
  • 打赏
  • 举报
回复
up myself.
liao_hb 2015-07-07
  • 打赏
  • 举报
回复
顶一下,哈哈
liao_hb 2015-07-07
  • 打赏
  • 举报
回复
默念一下,不要沉,不要沉......

50,530

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧