本文记录我在搭建gerrit的一些步骤和问题:
步骤
1. 下载gerrit 安装包 gerrit-2.14.war
2. 安装java, 在centos,root账户 使用 yum install java
3. 执行gerit,使用专门的账号, 创建gerrit2
sudo adduser gerrit2
sudo su gerrit2
4. 安装git
yum install git
5. 安装gerrit
java -jar gerit-2.14.war init -d /usr/local/gerit
5.1 如果选择用HTTP 验证方式:
5.1.1 下载httpd: yum install httpd
5.1.2.. gerrit config , 以及httpd的配置
[gerrit] basePath = git serverId = e34cf598-3c88-4e04-a483-5d6a307fa28d canonicalWebUrl = http://localhost:9091 [database] type = h2 database = /home/gerrit2/gerrit2_site3/db/ReviewDB [index] type = LUCENE [auth] type = HTTP [receive] enableSignedPush = false [sendemail] smtpServer = localhost [container] user = gerrit2 javaHome = /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-2.b11.el7_3.x86_64/jre [sshd] listenAddress = *:29418 [httpd] listenUrl = proxy-http://*:9090 [cache] directory = cache
Listen 9091 <VirtualHost *:9091> ServerName localhost ProxyRequests Off ProxyVia Off ProxyPreserveHost On <Proxy *> Order deny,allow Allow from all </Proxy> <Location '/login/'> AuthType Basic AuthName "Gerrit Code Review" AuthBasicProvider file AuthUserFile /etc/httpd/conf/passwords Require valid-user Order Deny,Allow Allow from all </Location> AllowEncodedSlashes On ProxyPass / http://localhost:9090/ nocanon </VirtualHost>
问题:
使用basic 的http,发现在浏览器登录以后,无法退出。 解决办法: 清楚浏览器记录后再次登录。