CentOS 7 Gitlab部署

1. 安装依赖软件

yum -y install policycoreutils policycoreutils-python openssh-server openssh-clients postfix

2.设置postfix开机自启,并启动,postfix支持gitlab发信功能

systemctl enable postfix && systemctl start postfix

3.下载gitlab安装包,然后安装

centos 7系统的下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7

下载rpm包并安装:

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.1.1-ce.0.el7.x86_64.rpm

rpm -ivh gitlab-ce-11.1.1-ce.0.el7.x86_64.rpm

4.修改gitlab配置

vim  /etc/gitlab/gitlab.rb

It looks like GitLab has not been configured yet; skipping the upgrade script.

       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.
  


     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/
  

Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
sudo gitlab-ctl reconfigure

指定服务器ip和自定义端口:


## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
external_url 'http://gitlab.xxx.io:8088'

5.重置并启动GitLab

执行:

gitlab-ctl reconfigure

gitlab-ctl restart

ok: run: alertmanager: (pid 28239) 1s
ok: run: gitaly: (pid 28249) 0s
ok: run: gitlab-monitor: (pid 28271) 1s
ok: run: gitlab-workhorse: (pid 28282) 0s
ok: run: logrotate: (pid 28294) 1s
ok: run: nginx: (pid 28301) 0s
ok: run: node-exporter: (pid 28351) 0s
ok: run: postgres-exporter: (pid 28357) 1s
ok: run: postgresql: (pid 28409) 0s
ok: run: prometheus: (pid 28417) 0s
ok: run: redis: (pid 28431) 1s
ok: run: redis-exporter: (pid 28456) 0s
ok: run: sidekiq: (pid 28484) 1s
ok: run: unicorn: (pid 28493) 0s

启动完成后即可访问

http://gitlab.xxx.io:8081/

如果502错误通过 gitlab-ctl tail unicorn 检查日志

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值