windows 搭建Gerrit

该文详细介绍了如何在Windows操作系统中安装Gerrit代码审查系统,使用Java11环境,并配置Apache服务器。步骤包括修改Apache的httpd.conf文件,设置监听端口,启用相关模块,创建用户密码文件,配置Gerrit的gerrit.config文件,以及启动Gerrit服务和Apache服务。
摘要由CSDN通过智能技术生成

Windows 安装Gerrit

  1. Java 11
  2. Gerrit
    https://gerrit-releases.storage.googleapis.com/index.html
  3. Apache
    https://link.zhihu.com/?target=https%3A//www.apachehaus.com/cgi-bin/download.plx

Apache

修改\conf\httpd.conf

Listen 8081
ServerName localhost:8081

保证下面这些选项是非注释状态

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so

httpd.exe -k install -n “Apache24”

运行 Apache24 是否可以正常运行

  1. 生成gerrit.passwd 文件

Apache24\bin\htpasswd.exe -c F:\Gerrit\etc\gerrit.passwd admin

  1. 末尾增加
<VirtualHost *:8081>
    ServerName localhost
    ProxyRequests Off
    ProxyVia Off
    ProxyPreserveHost On

    <Proxy *:8081>
        Require all granted
    </Proxy>  

     <Location "/login/">
        AuthType Basic
        AuthName "Gerrit Code Review"
        Require valid-user
        AuthBasicProvider file
        AuthUserFile F:\Gerrit\etc\gerrit.passwd
    </Location>
	AllowEncodedSlashes On
    ProxyPass / http://localhost:8082/
</VirtualHost>

Gerrit

安装
java -jar gerrit-3.5.1.war init –d F:\Gerrit

修改F:\Gerrit\etc\gerrit.config

[gerrit]
	basePath = git
	canonicalWebUrl = http://localhost:8082/
	serverId = 17234d8d-3aeb-4dbb-8978-4ee19f33376a
[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 = admin
	javaHome = D:\\software_install\\android-studio-2021.3.1.3-windows\\android-studio\\jre
[index]
	type = lucene
[auth]
	type = HTTP
[receive]
	enableSignedPush = false
[sendemail]
	smtpServer = localhost
[sshd]
	listenAddress = *:29418
[httpd]
	listenUrl = http://*:8082/
[cache]
	directory = cache

启动Gerrit

java -jar bin\gerrit.war daemon --console-log

启动apache

浏览器输入 http://localhost:8081

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值