GitLab官网:
https://about.gitlab.com/

官网
找到Resources(资源) | 选择Install(安装)

安装
找到服务器相对应的版本

版本
我以centos7为例

image.png
点击之后,安装的代码会在下面显示出来

image.png

代码2
1.安装并配置必要的依赖项
yum install -y curl \
policycoreutils-python \
openssh-server //安装依赖包
systemctl enable sshd //开机自启ssh服务
systemctl start sshd //开启sshd服务
firewall-cmd \
--permanent \
--add-service=http //添加防火墙出口
systemctl reload firewalld //防火墙配置生效
2.安装Postfix以发送通知电子邮件
yum install postfix //安装postfix
systemctl enable postfix //开机自启postfix
systemctl start postfix //开启postfix
3.添加GitLab软件包存储库并安装软件包
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
//添加GitLab包存储库。
yum install -y gitlab-ee //安装Gitlab
4.修改配置文件,设置服务器IP和端口。
vim /etc/gitlab/gitlab.rb //编辑配置文件
external_url 'https://gitlab.example.com' //配置服务器ip和端口
5.重置并启动GitLab
gitlab-ctl reconfigure //重置GitLab
gitlab-ctl restart //重启GitLab
6.登陆GitLab
网页访问https://IP:端口号
502报错排查
1.权限
chmod -R 755 /var/log/gitlab //增加权限
2.端口被占用
vim /etc/gitlab/gitlab.rb //编辑配置文件
external_url '*****:*****' //更改端口
3.内存不足
安装GitLab需要至少4G的内存