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

相關文章
相關標籤/搜索