gitlab 搭建


1. 搭建环境

  • Centos 7

2. 新建gitlab下载的配置文件

  • 文件位置:

/etc/yum.repos.d/gitlab_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

3. 安装所需依赖

sudo yum install curl openssh-server openssh-clients postfix cronie

  • 启动postfix

sudo service postfix start

  • 设置开机启动postfix

sudo chkconfig postfix on

  • 启动sshd

sudo systemctl enable sshd

  • 设置开机启动sshd

sudo systemctl start sshd

4. 安装gitlab

sudo yum makecache

  • 根据配置文件安装gitlab社区版

sudo yum install gitlab-ce

5. 修改gitlab配置文件

  • 配置文件文件位置:/etc/gitlab/gitlab.rb

  • 修改 external_url(外部访问地址)

external_url http://xxx.xxx.xxx.xxx

  • 初始化gitlab-ctl配置(也是启动gitlab),另外注意这个操作会重置gitlab的所有配置,第一次使用后不建议再使用

sudo gitlab-ctl reconfigure

5. 为防火墙添加网络服务,并重新加载使生效

sudo firewall-cmd –permanent –add-service=http

sudo systemctl reload firewalld

6. 访问gitlab (http://xxx.xxx.xxx.xxx

  • success
    在这里插入图片描述

###7. 补充

  • 进入gitlab控制台界面命令

gitlab-rails console production

  • 启动关闭gitlab

gitlab-ctl start/stop

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值