Linux中搭建gitlab服务

264 阅读1分钟

1. 安装和配置必要的依赖项

  在CentOS 7(和RedHat / Oracle / Scientific Linux 7)上,以下命令还将在系统防火墙中打开HTTP,HTTPS和SSH访问。

yum install -y curl policycoreutils-python openssh-server
systemctl enable sshd
systemctl start sshd
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

2.启动Postfix服务

  运行命令vim /etc/postfix/main.cf打开main.cf文件,找到下图内容

  将这行代码改为inet_interfaces = all

  运行命令sudo systemctl start postfix启动Postfix服务。

3.添加GitLab软件包仓库

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

4.安装gitlab

sudo EXTERNAL_URL="GitLab服务器的公网IP地址" yum install -y gitlab-ce

  使用浏览器访问GitLab服务器的公网IP地址。 返回页面如下图所示,表示环境搭建成功,并且您需要设置新密码。