Centos7下安装Gitlab-ce

  1. 更换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
    
  2. 安装和配置必要的依赖项

    在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接受默认值。

  3. 添加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
    
  4. 浏览器到主机名并登录

    第一次访问时,您将被重定向到密码重置界面。为初始管理员帐户提供密码,您将被重定向回登录界面。使用默认帐户的用户名root登录。

    有关安装和配置的详细说明,请参阅文档https://docs.gitlab.com/omnibus/README.html#installation-and-configuration-using-omnibus-package。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值