2021-05-24 -centos 搭建环境gitlab

1.配置服务器gitlab镜像位置 新建 /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
    #node: el$releasever  需要指定版本
  1. 安装SSH 和关闭防火墙

    $ sudo yum install -y curl policycoreutils-python openssh-server
    $ sudo systemctl enable sshd
    $ sudo systemctl start sshd
    $ sudo firewall-cmd --permanent --add-service=http
    $ sudo systemctl reload firewalld
    
  2. 安装 Postfix ,用来发送邮件,在安装 Postfix 的过程中选择'Internet Site'。

     $ sudo yum install postfix
     $ sudo systemctl enable postfix
     $ sudo systemctl start postfix
    
  3. 下载gitlab镜像 自己去清华大学官网下载 或者通过wget

     $ sudo yum makecache
    $ sudo yum install gitlab-ce
    或者
    $ wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
    在利用 rpm 命令解压  rpm -ivh    xxx.rpm
    
  4. 配置并启动 GitLab

    $ sudo gitlab-ctl reconfigure #首次启动也要用此命令。重新加载配置并启动
    $ sudo gitlab-ctl start # 启动
    $ sudo gitlab-ctl stop # 停止
    

引用:https://segmentfault.com/a/1190000019019787

你可能感兴趣的:(2021-05-24 -centos 搭建环境gitlab)