使用環境
OS:ubuntu 20.04 LTS ## 安裝
1 2 3 4 5 6 7 8 9
| sudo apt-get update sudo apt-get install -y curl openssh-server ca-certificates tzdata perl sudo apt-get install -y postfix curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
sudo EXTERNAL_URL="https://gitlab.example.com" apt-get install gitlab-ee
|
安裝過程時添加SSL
1 2 3 4
| mkdir /etc/gitlab/ssl
sudo chmod 700 /etc/gitlab/ssl vim /etc/gitlab/gitlab.rb
|
參數調整成以下
1 2 3 4 5 6
| nginx['enable'] = true nginx['redirect_http_to_https'] = true nginx['redirect_http_to_https_port'] = 80 nginx['ssl_certificate'] = "/etc/gitlab/ssl/<"自己的網域名稱">.crt" nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/<"自己的網域名稱">.key"
|
重新載入設定
1 2 3 4
| gitlab-ctl reconfigure
gitlab-ctl restart
|
開機時啟動
防火牆設定
1 2 3 4 5
| sudo ufw allow http sudo ufw allow https sudo ufw allow OpenSSH sudo ufw reload
|
參考資料
- https://about.gitlab.com/install/
- https://b8807053.pixnet.net/blog/post/344785258-gitlab-https