在CentOS系統中配置GitLab的SSL證書,通常需要以下幾個步驟:
獲取SSL證書:
安裝Certbot:
sudo yum install epel-release
sudo yum install certbot python2-certbot-apache
獲取并安裝SSL證書:
yourdomain.com
,運行以下命令:sudo certbot --apache -d yourdomain.com -d www.yourdomain.com
/etc/letsencrypt/live/yourdomain.com/
)。配置GitLab使用SSL:
/etc/gitlab/gitlab.rb
,找到或添加以下配置:external_url 'https://yourdomain.com'
external_url
指向你的域名,并且使用HTTPS。重新配置并重啟GitLab:
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
驗證SSL配置:
https://yourdomain.com
,確保SSL證書正確安裝并且頁面可以正常訪問。通過以上步驟,你應該能夠在CentOS系統中成功配置GitLab的SSL證書。