Windows 安装Gerrit
- Java 11
- Gerrit
https://gerrit-releases.storage.googleapis.com/index.html - 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 是否可以正常运行
- 生成gerrit.passwd 文件
Apache24\bin\htpasswd.exe -c F:\Gerrit\etc\gerrit.passwd admin
- 末尾增加
<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