Ubuntu22.04 安装 Gerrit3.7.0

安装java18 sudo apt-get install openjdk-18-jdk
安装apache2 sudo apt-get install apache2
安装gerrit java -jar gerrit-3.7.0.war init -d /gerrit_path
修改apache2 vim /etc/apache2/sites-available/000-default.conf
启动apache2 sudo /etc/init.d/apache2 restart
启动失败log:
Invalid command ‘ProxyRequests’, perhaps misspelled or defined by a module not included in the server configuration
apache2服务启动失败,缺少Proxy
执行:
sudo ln -s /etc/apache2/mods-available/proxy.conf /etc/apache2/mods-enabled/proxy.conf
sudo ln -s /etc/apache2/mods-available/proxy.load /etc/apache2/mods-enabled/proxy.load
sudo ln -s /etc/apache2/mods-available/proxy_http.load /etc/apache2/mods-enabled/proxy_http.load
再次重启apache2正常
重启apache2正常
启动gerrit
sudo bin/gerrit.sh start
com.google.gerrit.server.config.GitwebCgiConfig : gitweb not installed (no /usr/lib/cgi-bin/gitweb.cgi found)
org.eclipse.jetty.util.log : Logging initialized @4793ms to org.eclipse.jetty.util.log.Slf4jLog
备注
安装gitweb后使用 gerrit.sh start命令仍然启动失败,且没有相应log可以查看。改用run运行成功。
因此,gitweb是否必须待定,可以帮忙跳过验证。

安装gitweb sudo apt-get install gitweb
以下安装我没有选择重启系统或service,都是按了ESC退出,并不影响安装。
安装gitweb提示kernel版本较旧,选择ESC退出
是否重启部分服务,选择ESC退出

查看启动log sudo ./gerrit.sh run & (后台启动)

解决对应的错误问题(我这里是sendemail的设置多加了from设置导致启动失败)
Gerrit启动正常

附 000-default.conf 和 gerrit.config部分内容
/etc/apache2/sites-available/000-default.conf

	ServerName localhost

	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 /gerrit_path/etc/passwords
	</Location>

	AllowEncodedSlashes On
	ProxyPass / http://192.168.X.X:8081/ nocanon

gerrit_path/etc/gerrit.config

[gerrit]
        basePath = git
        canonicalWebUrl = http://192.168.X.X/
        serverId = 
[container]
        javaOptions = "-Dflogger.backend_factory=com.google.common.flogger.backend.log4j.Log4jBackendFactory#getInstance"
        javaOptions = "-Dflogger.logging_context=com.google.gerrit.server.logging.LoggingContext#getInstance"
        user = 
        javaHome = /usr/lib/jvm/java-18-openjdk-amd64
[index]
        type = lucene
[auth]
        type = HTTP
        userNameCaseInsensitive = true
[receive]
        enableSignedPush = false
[sendemail]
        enable = true
        smtpServer = 
        smtpServerPort = 
        smtpUser = 
        smtpPass = 
        from = 
[sshd]
        listenAddress = *:29418
[httpd]
        listenUrl = http://192.168.X.X:8081/
[cache]
        directory = cache

启动命令:nohup gerrit.sh run &

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值