安装gitlab前最好先关闭防火墙并安装邮件服务
1 2 3
| systemctl stop firewalld yum install -y postfix systemctl start postfix
|
gitlab安装
gitlab安装,使用rpm包安装,版本是8.8.5,注意不同的版本对应的系统要求不一样,本人用的centos系统。这个版本要求7以上。否则安装报错
1
| rpm -vih gitlab-ce-8.8.5-ce.1.el7.x86_64.rpm
|
安装完成以后,修改gitlab访问地址
1 2 3 4
| vim /etc/gitlab/gitlab.rb external_url 'http://gitlab.example.com'
external_url 'http://gitlab.test.com'
|
配置邮件服务
修改配置文件
1 2 3 4 5 6 7 8 9 10 11 12
| vim /etc/gitlab/gitlab.rb gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = "smtp.xxx.com" gitlab_rails['smtp_port'] = 25 gitlab_rails['smtp_user_name'] = "gitlab@xxx.com" gitlab_rails['smtp_password'] = "password" gitlab_rails['smtp_domain'] = "xxx.com" gitlab_rails['smtp_authentication'] = "login" gitlab_rails['smtp_enable_starttls_auto'] = true gitlab_rails['smtp_tls'] = false gitlab_rails['gitlab_email_from'] = 'gitlab@xxx.com' gitlab_rails['smtp_openssl_verify_mode'] = 'none'
|
配置生效
发送测试邮件测试是否正常
1 2 3 4
| gitlab-rails console
Notify.test_email('收件人', '主题', '正文').deliver_now
|
启动gitlab
查看gitlab状态