- 关闭防火墙
# 暂时关闭防火墙
systemctl stop firewalld
#永久关闭防火墙
systemctl disable firewalld
- 安装Postfix来实现邮件通知的功能
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
- 配置GitLab的仓库地址
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
可能由于网络原因经常不能成功下载安装包,所以我们要配置一下yum源,这样我们就能下载成功了
4. 在 /etc/yum.repos.d 下创建文件gitlab-ce.repo
# 创建文件
touch gitlab-ce.repo
# 写文件内容
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1
- 重新生成一下缓存
yum makecache
- 安装GitLab
yum install -y gitlab-ce
- 初始化GitLab
sudo gitlab-ctl reconfigure
就此,我们的GitLab搭建,接下来我们可以通过在浏览器的地址栏中输入虚拟机的ip地址即可,第一次进入这个页面让我们设置密码。然后就可以登录了。
账户:root
密码:就是我们刚自己设置的密码