gitlab安裝與郵件及域名配置
阿新 • • 發佈:2019-02-16
一、安裝gitlab
- 安裝gitlab yum 源:
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
- 通過yum安裝gitlab:
sudo yum -y install gitlab-ee
二、配置郵件通知
- 修改配置檔案vim /etc/gitlab/gitlab.rb,新增如下配置;
找到【GitLab email server settings】,在其中新增下如配置:
# 以下為阿里雲企業郵箱的配置
gitlab_rails['smtp_enable' ] = true
gitlab_rails['smtp_address'] = "smtp.mxhichina.com"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = "***@emjwash.com"
gitlab_rails['smtp_password'] = "******"
gitlab_rails['smtp_domain'] = "emjwash.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto' ] = true
gitlab_rails['gitlab_email_from'] = '***@emjwash.com'
- 重啟gitlab:/opt/gitlab/bin/gitlab-ctl reconfigure;
三、修改gitlab訪問域名
- 編輯配置檔案:vim /etc/gitlab/gitlab.rb;
# 修改http訪問地址
external_url 'http://120.76.*.*:82' # 採用IP訪問
external_url 'http://gitlab.****.com' # 採用域名訪問
# 修改ssh訪問埠
gitlab_rails['gitlab_shell_ssh_port' ] = 6022
- 重啟gitlab:/opt/gitlab/bin/gitlab-ctl reconfigure;