一、安装 Java 和 Apache
1、如文章下文章中一所示
2、安装 apache
sudo apt-get install apache2
安装完成启动是若出现如下警告:(并不存在实际问题,可以选择忽略)
* Starting web server apache2
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
通过编辑下面的文件,在文件末尾添加一行内容sudo vim /etc/apache2/apache2.conf
ServerName localhost #添加的内容
再重启 apache 服务即可消除该警告。管理apache服务的常用命令如下:
sudo service apache2 start/stop/restart #启动/停止/重启apache2
二、安装gerrit
1、新建 gerrit 专用账号
sudo adduser gerrit #这一步根据提示输入密码并确认信息
sudo su gerrit
cd
2、下载安装包并安装
可以自己选择安装包版本,这里以"gerrit-2.13.8.war"为例
wget http://gerrit-releases.storage.googleapis.com/gerrit-2.13.8.war
java -jar gerrit-2.13.8.war init -d review_site
这里我们可以一路回车,以默认的配置完成安装。后面可以对相关文件修改进行配置操作。
3、修改文件“gerrit.config”
vim ~/review_site/etc/gerrit.config