离线安装gitlab-ce-13.x.x
清华大学开源软件镜像站:
https://mirrors.tuna.tsinghua.edu.cn/
安装SSH协议
yum install -y curl policycoreutils-python openssh-server
设置SSH服务开机自启动
systemctl start sshd
systemctl enable sshd
添加HTTP/S服务到firewalld
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
重启防火墙
systemctl reload firewalld
安装Postfix以发送通知邮件
yum install postfix
systemctl enable postfix
systemctl start postfix
安装rpm包
rpm -ivh gitlab-ce-13.1.2-ce.0.el7.x86_64.rpm
修改配置文件
#编辑配置文件
vi /etc/gitlab/gitlab.rb
#修改访问URL
#格式:external_url 'http://ip:端口'
external_url 'http://192.168.1.1:8080'
#配置时区
gitlab_rails['time_zone'] = 'Asia/Shanghai'
防火墙开放端口
重置Gitlab
gitlab-ctl reconfigure
启动Gitlab
gitlab-ctl restart
gitlab访问提示502错误
vi /etc/gitlab/gitlab.rb
将下面这3行打开注释
#修改为没有使用的端口即可
external_url 'http://192.168.110.132:8899'
unicorn['worker_timeout'] = 90
unicorn['port'] = 8088
postgresql['shared_buffers'] = "256MB"
postgresql['max_connections'] = 200
gitlab-ctl reconfigure
gitlab-ctl restart