gerrit安装笔记
2014-03-14 08:49
288 查看
简介
这两天在折腾敏捷开发,安装gerrit,折腾惨了。郁闷啊,主要是apache的配置文件不熟悉,好多配置都是瞎配置。导致到处出错。系统:
root@pm:/var/www# uname -a Linux pm 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:13:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux root@pm:/var/www#
错误一
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 '/':
解决:
修改apache的ports.conf 文件,在里面添加对应的端口。
root@pm:/etc/apache2# cat ports.conf # If you just change the port or add more ports here, you will likely also # have to change the VirtualHost statement in # /etc/apache2/sites-enabled/000-default # This is also true if you have upgraded from before 2.2.9-3 (i.e. from # Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and # README.Debian.gz NameVirtualHost *:80 NameVirtualHost *:8090 Listen 80 Listen 8090 <IfModule mod_ssl.c> # If you add NameVirtualHost *:443 here, you will also have to change # the VirtualHost statement in /etc/apache2/sites-available/default-ssl # to <VirtualHost *:443> # Server Name Indication for SSL named virtual hosts is currently not # supported by MSIE on Windows XP. Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule> root@pm:/etc/apache2#
错误二
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 kona-gerrit:8080> ServerName kona-gerrit ProxyRequests Off ProxyVia Off ProxyPreserveHost On <Proxy *> Order deny,allow Allow from all </Proxy> <Location /login/> AuthType Basic AuthName "Gerrit Code Review" Require valid-user ... </Location> ProxyPass / http://.../ </VirtualHost>解决:
是你的代理配置没有配好。
该死的,就这个错误和下面这个错误,害的我整了整整2天。郁闷死我了。
错误三
gerrit 重定向循环解决:在gerrit的配置文件中增加:
root@pm:/data/app/git/review_site# cat etc/gerrit.config [gerrit] basePath = git canonicalWebUrl = http://192.168.16.118:8090/ #这一句明确了,就可以解决重定向的错误。注意,此处是填写apache中配的代理地址,而不是gerrit的listenUrl地址。
我的配置
apache2的配置:</VirtualHost> <VirtualHost *:8090> ServerName 10.0.16.8 ProxyRequests Off ProxyVia Off ProxyPreserveHost On <Proxy *> Order deny,allow Allow from all </Proxy> <Location "/login/"> AuthType Basic AuthName "Gerrit Code Review" Require valid-user AuthBasicProvider file AuthUserFile /data/app/git/review_site/etc/passwd </Location> ProxyPass / http://127.0.0.1:8080/ #ProxyPassReverse / http://127.0.0.1:8080/ #SetEnv force-proxy-request-1.0.1 #SetEnv proxy-nokeepalive 1 </VirtualHost>ports.conf文件:
root@pm:~/bin# cat /etc/apache2/ports.conf # If you just change the port or add more ports here, you will likely also # have to change the VirtualHost statement in # /etc/apache2/sites-enabled/000-default # This is also true if you have upgraded from before 2.2.9-3 (i.e. from # Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and # README.Debian.gz NameVirtualHost *:80 NameVirtualHost *:8090 Listen 80 Listen 8090 <IfModule mod_ssl.c> # If you add NameVirtualHost *:443 here, you will also have to change # the VirtualHost statement in /etc/apache2/sites-available/default-ssl # to <VirtualHost *:443> # Server Name Indication for SSL named virtual hosts is currently not # supported by MSIE on Windows XP. Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule> root@pm:~/bin#
gerrit的配置:
root@pm:~/bin# cat /data/app/git/review_site/etc/gerrit.config [gerrit] basePath = git canonicalWebUrl = http://192.168.16.118:8090/ [database] type = MYSQL hostname = localhost database = reviewdb username = git [auth] type = HTTP [sendemail] smtpServer = localhost [container] user = git javaHome = /usr/lib/jvm/jdk1.6.0_37/jre [sshd] listenAddress = *:29418 [httpd] listenUrl = http://*:8080/ [cache] directory = cache root@pm:~/bin#
参考
http://stackoverflow.com/questions/18179728/set-up-gerrit-with-http-authenticationProxyPass与ProxyPassReverse及ProxyPassMatch的概述
Gerrit简易安装入门
Ubuntu下安装Gerrit
Ubuntu 建立 Gerrit服务器 配置文件
烤鸭的gerrit使用说明
相关文章推荐
- gerrit 安装笔记
- gerrit 安装笔记
- 服务安装笔记1 apace2+php5+mysql
- MQTT学习笔记——MQTT协议体验 Mosquitto安装和使用
- Python学习笔记(3):MongoDB的安装
- Java基础学习笔记二十四 MySQL安装图解
- Docker学习笔记——binary安装
- [Spring Roo 笔记] 安装及初始化
- Docker学习笔记(1) -- 安装docker
- Maven学习笔记---maven的安装与本地仓库的配置
- Ubuntu 使用笔记------win7下安装ubuntu12.04(64位)
- CentOS6.4U盘安装笔记
- 【笔记】CentOS上源码安装GCC 4.8.2
- Apache Tez 0.7、0.83、 0.82 安装、调试笔记
- 【笔记2】关于Linux 802.11n csi tool的安装注意事项
- oracle安装笔记
- hadoop学习笔记(7)-Hadoop+Zookeeper+HBase分布式安装部署
- OpenCV 学习笔记(1)安装设置、显示图像
- Windows系统安装笔记