Centos 7安裝Gitlab服务器

1、安装依赖软件

    做者本人用的是Centos 7html

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

2、下载gitlab安装包,而后安装

  • centos 6下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
  • centos 7下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7

    下载rpm包并安装(建议下载一个比较新的版本):node

    由于本人是Centos 7因此下载了最新版本gitlab-ce-9.5.5-ce.0.el7.x86_64.rpmnginx

[root@bogon guoda]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-9.5.5-ce.0.el7.x86_64.rpm
--2017-09-22 00:40:57--  https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-9.5.5-ce.0.el7.x86_64.rpm
正在解析主机 mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.6.177, 2402:f000:1:416:101:6:6:177
正在链接 mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.6.177|:443... 已链接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:399949109 (381M) [application/x-redhat-package-manager]
正在保存至: “gitlab-ce-9.5.5-ce.0.el7.x86_64.rpm”
15%[=============>                                                                   ]62.519.641  3.44MB/s 剩余 54s
[root@bogon xxx]# rpm -i gitlab-ce-9.5.5-ce.0.el7.x86_64.rpm 
警告:gitlab-ce-9.5.5-ce.0.el7.x86_64.rpm: 头V4 RSA/SHA1 Signature, 密钥 ID f27eab47: NOKEY


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

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


gitlab: Thank you for installing GitLab!
gitlab: To configure and start GitLab, RUN THE FOLLOWING COMMAND:

sudo gitlab-ctl reconfigure

gitlab: GitLab should be reachable at http://bogon
gitlab: Otherwise configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
gitlab: And running reconfigure again.
gitlab: 
gitlab: For a comprehensive list of configuration options please see the Omnibus GitLab readme
gitlab: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
gitlab: 
It looks like GitLab has not been configured yet; skipping the upgrade script.
[root@bogon xxx]#

三.修改gitlab配置文件

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

[root@bogon gitlab]# vim gitlab.rb 

## GitLab configuration settings
##! This file is generated during initial installation and **is not** modified
##! during upgrades.
##! Check out the latest version of this file to know about the different
##! settings that can be configured by this file, which may be found at:
##! https://gitlab.com/gitlab-org/omnibus-gitlab/raw/master/files/gitlab-config-template/gitlab.rb.template


## 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://192.168.1.77:8090'

4、重置并重启Gitlab服务器

    执行:redis

  • gitlab-ctl reconfigure
  • gitlab-ctl restart
[root@bogon gitlab]# gitlab-ctl start
ok: run: gitaly: (pid 7228) 418s
ok: run: gitlab-monitor: (pid 7328) 395s
ok: run: gitlab-workhorse: (pid 7253) 414s
ok: run: logrotate: (pid 6481) 944s
ok: run: nginx: (pid 6425) 965s
ok: run: node-exporter: (pid 6557) 928s
ok: run: postgres-exporter: (pid 7355) 388s
ok: run: postgresql: (pid 5906) 1087s
ok: run: prometheus: (pid 7340) 391s
ok: run: redis: (pid 5783) 1098s
ok: run: redis-exporter: (pid 6655) 894s
ok: run: sidekiq: (pid 6199) 990s
ok: run: unicorn: (pid 6131) 996s
[root@bogon gitlab]#

     提示“ok: run:”表示启动成功sql

5、访问 GitLab页面

    直接输入服务器ip和指定端口进行访问,第一次登陆修改密码vim

    初始帐户: root 密码: 5iveL!fecentos

相关文章
相关标签/搜索