Ubuntu 20.04 + Gerrit 3.4.0 + nginx 1.18.0 安裝配置指南
1、前言
2020/09/22 15:10 本人發佈過一篇 ” Ubuntu 18.04+Postgresql 10+Gerrit 2.15.19+nginx 1.14 “ 安裝配置指南,原文鏈接如下:
Ubuntu 18.04+Postgresql 10+Gerrit 2.15.19+nginx 1.14 閱讀數 1.4K ,快一年時間了,各系統也都升級了,今天繼續分享新版本的安裝配置。
2、系統平臺
- 操作系統:Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-77-generic x86_64
- 數據庫: NoteDb 是 Gerrit 3.0+ 支持的唯一數據庫格式
- 官方介紹如下
- 代碼審查系統:Gerrit 3.4.0
- Web 服務器:nginx version: nginx/1.18.0 (Ubuntu) 高性能的 HTTP 和反向代理 Web 服務器
- 瀏覽器訪問
3、安裝配置
首先要執行一下系統更新,執行如下兩條指令:
scm@scm:~$ java -jar gerrit-3.4.0.war init -d /home/scm/review_site
Using secure store: com.google.gerrit.server.securestore.DefaultSecureStore
[2021-07-20 08:25:51,417] [main] INFO com.google.gerrit.server.config.GerritServerConfigProvider : No /home/scm/review_site/etc/gerrit.config; as suming defaults
*** Gerrit Code Review 3.4.0
***
Create '/home/scm/review_site' [Y/n]? Y
*** Git Repositories
***
Location of Git repositories [git]: git
*** JGit Configuration
***
Auto-configured "receive.autogc = false" to disable auto-gc after git-receive-pack.
*** Index
***
Type [lucene]:
*** User Authentication
***
Authentication method [openid/?]: http
Get username from custom HTTP header [y/N]? n
SSO logout URL :
Enable signed push support [y/N]?
*** Review Labels
***
Install Verified label [y/N]? y
*** Email Delivery
***
SMTP server hostname [localhost]:
SMTP server port [(default)]:
SMTP encryption [none/?]:
SMTP username :
*** Container Process
***
Run as [scm]:
Java runtime [/usr/local/jdk-11.0.10]:
Copy gerrit-3.4.0.war to /home/scm/review_site/bin/gerrit.war [Y/n]? Y
Copying gerrit-3.4.0.war to /home/scm/review_site/bin/gerrit.war
*** SSH Daemon
***
Listen on address [*]:
Listen on port [29418]:
Generating SSH host key ... rsa... ed25519... ecdsa 256... ecdsa 384... ecdsa 521... done
*** HTTP Daemon
***
Behind reverse proxy [y/N]? y
Proxy uses SSL (https://) [y/N]?
Subdirectory on proxy server [/]:
Listen on address [*]:
Listen on port [8081]:
Canonical URL [http://scm/]: http://192.168.23.134
*** Cache
***
*** Plugins
***
Installing plugins.
Install plugin codemirror-editor version v3.4.0 [y/N]? y
Installed codemirror-editor v3.4.0
Install plugin commit-message-length-validator version v3.4.0 [y/N]? y
Installed commit-message-length-validator v3.4.0
Install plugin delete-project version v3.4.0 [y/N]? y
Installed delete-project v3.4.0
Install plugin download-commands version v3.4.0 [y/N]? y
Installed download-commands v3.4.0
Install plugin gitiles version v3.4.0 [y/N]? y
Installed gitiles v3.4.0
Install plugin hooks version v3.4.0 [y/N]? y
Installed hooks v3.4.0
Install plugin plugin-manager version v3.4.0 [y/N]? y
Installed plugin-manager v3.4.0
Install plugin replication version v3.4.0 [y/N]? y
Installed replication v3.4.0
Install plugin reviewnotes version v3.4.0 [y/N]? y
Installed reviewnotes v3.4.0
Install plugin singleusergroup version v3.4.0 [y/N]? y
Installed singleusergroup v3.4.0
Install plugin webhooks version v3.4.0 [y/N]? y
Installed webhooks v3.4.0
Initializing plugins.
============================================================================
Welcome to the Gerrit community
Find more information on the homepage: https://www.gerritcodereview.com
Discuss Gerrit on the mailing list: https://groups.google.com/g/repo-discuss
============================================================================
Initialized /home/scm/review_site
Init complete, reindexing accounts with: reindex --site-path /home/scm/review_site --threads 1 --index accountsReindexed 0 documents in accounts i ndex in 0.0s (0.0/s)
Index accounts in version 11 is ready
Collecting projects: 2 changes with: reindex --site-path /home/scm/review_site --threads 1 --index changes
Reindexing changes: project-slices: 100% (2/2), done
Reindexed 0 documents in changes index in 0.0s (0.0/s)
Index changes in version 61 is ready
Reindexing groups: 100% (2/2)ith: reindex --site-path /home/scm/review_site --threads 1 --index groups
Reindexed 2 documents in groups index in 0.2s (10.2/s)
Index groups in version 8 is ready
Reindexing projects: 100% (2/2) with: reindex --site-path /home/scm/review_site --threads 1 --index projects
Reindexed 2 documents in projects index in 0.1s (13.4/s)
Index projects in version 4 is ready
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
auth_basic "GerritCodeReview";
auth_basic_user_file /home/scm/review_site/etc/passwords;
proxy_pass http://192.168.23.134:8081/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
}