文章目录
1. gerrit下载
gerrit官网下载:https://www.gerritcodereview.com/releases-readme.html
如果是在虚拟机安装gerrit,本地PC下载的war包,不能通过vmtools直接拖动复制粘贴到虚拟机内部,会造成包损坏。可以通过scp或者FTP上传。
2. Ubuntu新增gerrit账号
sudo useradd gerrit -m -s /bin/bash
sudo passwd gerrit
# 将gerrit加入sudo权限
sudo vi /etc/sudoers
# 增加 gerrit ALL=(ALL:ALL) ALL
# 切换到gerrit账号
su gerrit
# 将gerrit-2.15.22.war文件上传到gerrit账户目录,如/home/gerrit
# 修改gerrit-2.15.22.war文件权限为777
chmod 777 gerrit-2.15.22.war
3. 安装git
Linux系统一般默认安装了git
sudo apt-get install git
4. 安装Apache2
sudo apt-get install apache2
5. 配置Apache2
- 进入apache2设置目录
cd /etc/apache2
- 修改以下三个配置文件:
httpd.conf
apache2.conf
ports.conf
ps. httpd.conf文件没有的话需要手动创建
sudo touch /etc/apache2/httpd.conf
sudo vi /etc/apache2/httpd.conf
- 配置httpd.conf
<VirtualHost *:8080>
ServerName xxx.xx.xxx.xx: # ubuntu系统IP地址
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 /home/gerrit/review

最低0.47元/天 解锁文章
2763

被折叠的 条评论
为什么被折叠?



