1. 安装环境依赖组件
yum install curl policycoreutils openssh-server openssh-clients
systemctl enable sshd
systemctl restart sshd
yum install postfix
yum install postfix
systemctl start postfix(报错:end-mail: fatal: parameter inet_interfaces: no local interface found for ::1。修改/etc/postfix/main.cf 参数inet_interfaces=all)
2. 下载并安装
curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.3-ce.0.el7.x86_64.rpm
yum localinstall -y gitlab-ce-10.0.3-ce.0.el7.x86_64.rpm
3. 修改配置文件(gitlab.rb)
#git-web访问地址
external_url 'https://git.jingyubao.com/'
#git仓库的存放地址
git_data_dir "/data/git-project"
#ssh访问用的端口
gitlab_rails['gitlab_shell_ssh_port'] = 14573
#email信息配置
gitlab_rails['gitlab_email_from'] = '***@**.com'
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.**.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "***@**.com"
gitlab_rails['smtp_password'] = "*********"
gitlab_rails['smtp_domain'] = "smtp.exmail.qq.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
#ssl配置
nginx['redirect_http_to_https'] =true
nginx['ssl_certificate'] = "/etc/gitlab/ssl/*.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/*.key"
4. 执行修改的配置并重启
gitlab-ctl reconfigure
gitlab-ctl restart
5. 访问gitlab页面(root 5iveL!fe)
http://123.207.215.59:8080
6. 访问gitlab页面502
①修改/etc/gitlab/gitlab.rb(2个参数对应的端口一致)
unicorn['port'] = 8888
gitlab_workhorse['auth_backend'] = "http://localhost:8888"
②重新执行配置
gitlab-ctl reconfigure
gitlab-ctl restart
参考链接:https://www.jianshu.com/p/a22eaa1fcfe7