-
更换gitlab-ce镜像源
新建
/etc/yum.repos.d/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
再执行
sudo yum makecache sudo yum install gitlab-ce
-
安装和配置必要的依赖项
在CentOS 7上,下面的命令还将打开系统防火墙中的HTTP和SSH访问。
sudo yum install -y curl policycoreutils-python openssh-server openssh-clients sudo systemctl enable sshd sudo systemctl start sshd sudo firewall-cmd --permanent --add-service=http sudo systemctl reload firewalld
接下来,安装Postfix发送通知电子邮件。如果您想使用其他解决方案发送电子邮件,请跳过此步骤,并在GitLab安装后配置一个外部SMTP服务器。
sudo yum install postfix sudo systemctl enable postfix sudo systemctl start postfix
在Postfix安装期间,可能会出现配置界面。选择“Internet Site”并按回车键。使用服务器的外部DNS作为“邮件名称”,然后按enter。如果出现其他屏幕,则继续按enter接受默认值。
-
添加GitLab包存储库并安装包
添加GitLab包存储库。
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
接下来,安装GitLab包。将https://gitlab.example.com更改为您希望访问GitLab实例的URL。安装将自动配置并在该URL处启动GitLab。
对于
https://
URLs, GitLab将自动请求一个带有Let’s Encrypt Integration的证书,这需要入站HTTP访问和一个有效的主机名。您也可以使用自己的证书或只使用http://。sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ce
-
浏览器到主机名并登录
第一次访问时,您将被重定向到密码重置界面。为初始管理员帐户提供密码,您将被重定向回登录界面。使用默认帐户的用户名
root
登录。有关安装和配置的详细说明,请参阅文档https://docs.gitlab.com/omnibus/README.html#installation-and-configuration-using-omnibus-package。
Centos7下安装Gitlab-ce
最新推荐文章于 2024-05-24 17:17:42 发布