windows 搭建Gerrit

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. 末尾增加

    ServerName localhost
    ProxyRequests Off
    ProxyVia Off
    ProxyPreserveHost On

    
        Require all granted
      

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

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

你可能感兴趣的:(Git,Gerrit)