gitlab管理之一---gitlab在Centos 7.5上面的安装

1. 环境及条件:

系统:CentOS Linux release 7.5.1804 (Core)

IP地址: 192.168.2.201

内存:建议至少2GB

权限:root用户权限

2. 安装gitlab服务器所要使用到的包和功能。

注意:如果使用别的邮件服务器的话,此处可以不用安装postfix.

 [[email protected] ~]# yum -y install curl policycoreutils openssh-server openssh-clients postfix
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
      * base: mirrors.sohu.com
      * extras: mirrors.sohu.com
      * updates: mirrors.sohu.com
    Package curl-7.29.0-46.el7.x86_64 already installed and latest version
    Package policycoreutils-2.5-22.el7.x86_64 already installed and latest version
    Package openssh-server-7.4p1-16.el7.x86_64 already installed and latest version
    Package openssh-clients-7.4p1-16.el7.x86_64 already installed and latest version
    Package 2:postfix-2.10.1-6.el7.x86_64 already installed and latest version
    Nothing to do

    [[email protected] ~]# systemctl start sshd
    [[email protected] ~]# systemctl start postfix
    [[email protected] ~]# systemctl enable sshd
    [[email protected] ~]# systemctl enable postfix

3. 安装Gitlab

(1)Gitlab提供了一个安装安装器,可以简化安装的一些步骤。 下载安装器,并执行脚本。

 [[email protected] ~]# curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
    Detected operating system as centos/7.
    Checking for curl...
    Detected curl...
    Downloading repository file: https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/config_file.repo?os=centos&dist=7&source=script
    done.
    Installing pygpgme to verify GPG signatures...
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
      * base: mirrors.sohu.com
      * extras: mirrors.sohu.com
      * updates: mirrors.sohu.com
    gitlab_gitlab-ce-source/signature                                                                                             |  836 B  00:00:00    
    Retrieving key from https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
    Importing GPG key 0xE15E78F4:
      Userid     : "GitLab B.V. (package repository signing key) <[email protected]>"
      Fingerprint: 1a4c 919d b987 d435 9396 38b9 1421 9a96 e15e 78f4
      From       : https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
    Retrieving key from https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey/gitlab-gitlab-ce-3D645A26AB9FBD22.pub.gpg
    gitlab_gitlab-ce-source/signature                                                                                             |  951 B  00:00:01 !!!
    gitlab_gitlab-ce-source/primary                                                                                               |  175 B  00:00:02    
    Package pygpgme-0.3-9.el7.x86_64 already installed and latest version
    Nothing to do
    Installing yum-utils...
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
      * base: mirrors.sohu.com
      * extras: mirrors.sohu.com
      * updates: mirrors.sohu.com
    Resolving Dependencies
    --> Running transaction check
    ---> Package yum-utils.noarch 0:1.1.31-45.el7 will be installed
    --> Processing Dependency: python-kitchen for package: yum-utils-1.1.31-45.el7.noarch
    --> Processing Dependency: libxml2-python for package: yum-utils-1.1.31-45.el7.noarch
    --> Running transaction check
    ---> Package libxml2-python.x86_64 0:2.9.1-6.el7_2.3 will be installed
    ---> Package python-kitchen.noarch 0:1.1.1-5.el7 will be installed
    --> Processing Dependency: python-chardet for package: python-kitchen-1.1.1-5.el7.noarch
    --> Running transaction check
    ---> Package python-chardet.noarch 0:2.2.1-1.el7_1 will be installed
    --> Finished Dependency Resolution

    Dependencies Resolved

    =====================================================================================================================================================
      Package                                Arch                           Version                                    Repository                    Size
    =====================================================================================================================================================
    Installing:
      yum-utils                              noarch                         1.1.31-45.el7                              base                         119 k
    Installing for dependencies:
      libxml2-python                         x86_64                         2.9.1-6.el7_2.3                            base                         247 k
      python-chardet                         noarch                         2.2.1-1.el7_1                              base                         227 k
      python-kitchen                         noarch                         1.1.1-5.el7                                base                         267 k

    Transaction Summary
    =====================================================================================================================================================
    Install  1 Package (+3 Dependent packages)

    Total download size: 859 k
    Installed size: 4.3 M
    Downloading packages:
    (1/4): libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm                                                                              | 247 kB  00:00:00    
    (2/4): python-chardet-2.2.1-1.el7_1.noarch.rpm                                                                                | 227 kB  00:00:00    
    (3/4): yum-utils-1.1.31-45.el7.noarch.rpm                                                                                     | 119 kB  00:00:00    
    (4/4): python-kitchen-1.1.1-5.el7.noarch.rpm                                                                                  | 267 kB  00:00:06    
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    Total                                                                                                                136 kB/s | 859 kB  00:00:06    
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
       Installing : python-chardet-2.2.1-1.el7_1.noarch                                                                                               1/4
       Installing : python-kitchen-1.1.1-5.el7.noarch                                                                                                 2/4
       Installing : libxml2-python-2.9.1-6.el7_2.3.x86_64                                                                                             3/4
       Installing : yum-utils-1.1.31-45.el7.noarch                                                                                                    4/4
       Verifying  : yum-utils-1.1.31-45.el7.noarch                                                                                                    1/4
       Verifying  : libxml2-python-2.9.1-6.el7_2.3.x86_64                                                                                             2/4
       Verifying  : python-kitchen-1.1.1-5.el7.noarch                                                                                                 3/4
       Verifying  : python-chardet-2.2.1-1.el7_1.noarch                                                                                               4/4

    Installed:
       yum-utils.noarch 0:1.1.31-45.el7                                                                                                                  

    Dependency Installed:
       libxml2-python.x86_64 0:2.9.1-6.el7_2.3            python-chardet.noarch 0:2.2.1-1.el7_1            python-kitchen.noarch 0:1.1.1-5.el7          

    Complete!
    Generating yum cache for gitlab_gitlab-ce...
    Importing GPG key 0xE15E78F4:
      Userid     : "GitLab B.V. (package repository signing key) <[email protected]>"
      Fingerprint: 1a4c 919d b987 d435 9396 38b9 1421 9a96 e15e 78f4
      From       : https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey

    The repository is setup! You can now install packages.

(2)安装Gitlab,执行以下命令:

  yum –y install gitlab-ce

安装成功后截图:

   [[email protected] ~]#  yum -y install gitlab-ce
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
      * base: mirrors.sohu.com
      * extras: mirrors.sohu.com
      * updates: mirrors.sohu.com
    Resolving Dependencies
    --> Running transaction check
    ---> Package gitlab-ce.x86_64 0:11.0.0-ce.0.el7 will be installed
    --> Processing Dependency: policycoreutils-python for package: gitlab-ce-11.0.0-ce.0.el7.x86_64
    --> Running transaction check
    ---> Package policycoreutils-python.x86_64 0:2.5-22.el7 will be installed
    --> Processing Dependency: setools-libs >= 3.3.8-2 for package: policycoreutils-python-2.5-22.el7.x86_64
    --> Processing Dependency: libsemanage-python >= 2.5-9 for package: policycoreutils-python-2.5-22.el7.x86_64
    --> Processing Dependency: audit-libs-python >= 2.1.3-4 for package: policycoreutils-python-2.5-22.el7.x86_64
    --> Processing Dependency: python-IPy for package: policycoreutils-python-2.5-22.el7.x86_64
    --> Processing Dependency: libqpol.so.1(VERS_1.4)(64bit) for package: policycoreutils-python-2.5-22.el7.x86_64
    --> Processing Dependency: libqpol.so.1(VERS_1.2)(64bit) for package: policycoreutils-python-2.5-22.el7.x86_64
    --> Processing Dependency: libcgroup for package: policycoreutils-python-2.5-22.el7.x86_64
    --> Processing Dependency: libapol.so.4(VERS_4.0)(64bit) for package: policycoreutils-python-2.5-22.el7.x86_64
    --> Processing Dependency: checkpolicy for package: policycoreutils-python-2.5-22.el7.x86_64
    --> Processing Dependency: libqpol.so.1()(64bit) for package: policycoreutils-python-2.5-22.el7.x86_64
    --> Processing Dependency: libapol.so.4()(64bit) for package: policycoreutils-python-2.5-22.el7.x86_64
    --> Running transaction check
    ---> Package audit-libs-python.x86_64 0:2.8.1-3.el7 will be installed
    ---> Package checkpolicy.x86_64 0:2.5-6.el7 will be installed
    ---> Package libcgroup.x86_64 0:0.41-15.el7 will be installed
    ---> Package libsemanage-python.x86_64 0:2.5-11.el7 will be installed
    ---> Package python-IPy.noarch 0:0.75-6.el7 will be installed
    ---> Package setools-libs.x86_64 0:3.3.8-2.el7 will be installed
    --> Finished Dependency Resolution

    Dependencies Resolved

    =====================================================================================================================================================
      Package                                   Arch                      Version                               Repository                           Size
    =====================================================================================================================================================
    Installing:
      gitlab-ce                                 x86_64                    11.0.0-ce.0.el7                       gitlab_gitlab-ce                    414 M
    Installing for dependencies:
      audit-libs-python                         x86_64                    2.8.1-3.el7                           base                                 75 k
      checkpolicy                               x86_64                    2.5-6.el7                             base                                294 k
      libcgroup                                 x86_64                    0.41-15.el7                           base                                 65 k
      libsemanage-python                        x86_64                    2.5-11.el7                            base                                112 k
      policycoreutils-python                    x86_64                    2.5-22.el7                            base                                454 k
      python-IPy                                noarch                    0.75-6.el7                            base                                 32 k
      setools-libs                              x86_64                    3.3.8-2.el7                           base                                619 k

    Transaction Summary
    =====================================================================================================================================================
    Install  1 Package (+7 Dependent packages)

    Total download size: 416 M
    Installed size: 1.2 G
    Downloading packages:
    (1/8): audit-libs-python-2.8.1-3.el7.x86_64.rpm                                                                               |  75 kB  00:00:00    
    (2/8): checkpolicy-2.5-6.el7.x86_64.rpm                                                                                       | 294 kB  00:00:00    
    (3/8): libcgroup-0.41-15.el7.x86_64.rpm                                                                                       |  65 kB  00:00:00    
    (4/8): python-IPy-0.75-6.el7.noarch.rpm                                                                                       |  32 kB  00:00:00    
    (5/8): libsemanage-python-2.5-11.el7.x86_64.rpm                                                                               | 112 kB  00:00:00    
    (6/8): policycoreutils-python-2.5-22.el7.x86_64.rpm                                                                           | 454 kB  00:00:00    
    (7/8): setools-libs-3.3.8-2.el7.x86_64.rpm                                                                                    | 619 kB  00:00:00    
    warning: /var/cache/yum/x86_64/7/gitlab_gitlab-ce/packages/gitlab-ce-11.0.0-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
    Public key for gitlab-ce-11.0.0-ce.0.el7.x86_64.rpm is not installed
    (8/8): gitlab-ce-11.0.0-ce.0.el7.x86_64.rpm                                                                                   | 414 MB  00:30:15    
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    Total                                                                                                                235 kB/s | 416 MB  00:30:15    
    Retrieving key from https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
    Importing GPG key 0xE15E78F4:
      Userid     : "GitLab B.V. (package repository signing key) <[email protected]>"
      Fingerprint: 1a4c 919d b987 d435 9396 38b9 1421 9a96 e15e 78f4
      From       : https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
    Retrieving key from https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey/gitlab-gitlab-ce-3D645A26AB9FBD22.pub.gpg
    Importing GPG key 0xF27EAB47:
      Userid     : "GitLab, Inc. <[email protected]>"
      Fingerprint: dbef 8977 4ddb 9eb3 7d9f c3a0 3cfc f9ba f27e ab47
      From       : https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey/gitlab-gitlab-ce-3D645A26AB9FBD22.pub.gpg
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
       Installing : checkpolicy-2.5-6.el7.x86_64                                                                                                      1/8
       Installing : audit-libs-python-2.8.1-3.el7.x86_64                                                                                              2/8
       Installing : python-IPy-0.75-6.el7.noarch                                                                                                      3/8
       Installing : libcgroup-0.41-15.el7.x86_64                                                                                                      4/8
       Installing : setools-libs-3.3.8-2.el7.x86_64                                                                                                   5/8
       Installing : libsemanage-python-2.5-11.el7.x86_64                                                                                              6/8
       Installing : policycoreutils-python-2.5-22.el7.x86_64                                                                                          7/8
       Installing : gitlab-ce-11.0.0-ce.0.el7.x86_64                                                                                                  8/8
    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

    For a comprehensive list of configuration options please see the Omnibus GitLab readme
    https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

      Verifying  : libsemanage-python-2.5-11.el7.x86_64                                                                                              1/8
       Verifying  : setools-libs-3.3.8-2.el7.x86_64                                                                                                   2/8
       Verifying  : policycoreutils-python-2.5-22.el7.x86_64                                                                                          3/8
       Verifying  : libcgroup-0.41-15.el7.x86_64                                                                                                      4/8
       Verifying  : gitlab-ce-11.0.0-ce.0.el7.x86_64                                                                                                  5/8
       Verifying  : python-IPy-0.75-6.el7.noarch                                                                                                      6/8
       Verifying  : audit-libs-python-2.8.1-3.el7.x86_64                                                                                              7/8
       Verifying  : checkpolicy-2.5-6.el7.x86_64                                                                                                      8/8

    Installed:
       gitlab-ce.x86_64 0:11.0.0-ce.0.el7                                                                                                                

    Dependency Installed:
       audit-libs-python.x86_64 0:2.8.1-3.el7     checkpolicy.x86_64 0:2.5-6.el7 libcgroup.x86_64 0:0.41-15.el7    libsemanage-python.x86_64 0:2.5-11.el7
       policycoreutils-python.x86_64 0:2.5-22.el7 python-IPy.noarch 0:0.75-6.el7 setools-libs.x86_64 0:3.3.8-2.el7

    Complete!

3.(1)配置 Gitlab URL

cd /etc/gitlab/
vim gitlab.rb

改变gitlab服务器的外部域名

![](https://blog.xiodi.cn/wp-content/uploads/2018/07/a725c373ac0394670b3b319c9db05bf0.png)

(2)执行下面命令让配置生效。

gitlab-ctl reconfigure

4. 配置防火墙

(1)开启防火墙

systemctl start firewalld
systemctl enable firewalld

(2)开放所需服务,如下是开通ssh, http,https服务.

 [[email protected] gitlab]# firewall-cmd --permanent --add-service ssh
    success
    [[email protected] gitlab]# firewall-cmd --permanent --add-service http
    success
    [[email protected] gitlab]# firewall-cmd --permanent --add-service https
    success

   [[email protected] gitlab]# firewall-cmd --reload
    success

(3)校验开通了哪些服务,使用以下命令

[[email protected] gitlab]# firewall-cmd --list-all
    public (active)
       target: default
       icmp-block-inversion: no
       interfaces: ens33
       sources:
       services: ssh dhcpv6-client http https
       ports:
       protocols:
       masquerade: no
       forward-ports:
       source-ports:
       icmp-blocks:
       rich rules:

5. 执行基本配置

(1)设置密码

(2)进行登陆,默认的用户名是root.

![](https://blog.xiodi.cn/wp-content/uploads/2018/07/3b1b56ca94019ec52a9bdfe992c5f551.png)

(3) 点击如下图所示,更改个人信息。

![](https://blog.xiodi.cn/wp-content/uploads/2018/07/bb005f70a8ab8683e250300334e6a46d.png)

原文地址:http://blog.51cto.com/13856449/2137500

时间: 2024-10-01 04:28:53

gitlab管理之一---gitlab在Centos 7.5上面的安装的相关文章

XEN虚拟化简介及XEN在CentOS 6.5上的安装

根据之前KVM虚拟化的整理,虚拟化技术分类如下: 虚拟化技术的分类: (1) 模拟:Emulation Qemu, PearPC, Bochs (2) 完全虚拟化:Full Virtualization, Native Virtualization HVM VMware Workstation, VirtualBox, VMware Server, Parallels Desktop, KVM, Xen (3) 半虚拟化:ParaVirtualization GuestOS:知晓自己是运行Vir

GitLab管理之 - Gitlab 用户管理

1. 移除用户 (1) 使用管理员登陆Gitlab服务器 (2) 点击管理区域 (3) 点击Users. (4)点击[Block User] 2. 添加用户(1)用root 管理员登陆.(2)点击[管理区域] (3)点击[New User] (4)输入用户相关信息 名字(name),用户名(username),邮箱信息(Email)等 (5)用户会收到邮件如下画面,点击设置密码即可. (6) 如果用户没有收到邮件,那么管理员还可以设置初始密码,在user中找到对应用户,点击edit (7) 设置

Gitlab管理之八–Gitlab之挤压提交信息

简介 在开发的时候可能由于频繁的提交信息,比较零散和片断,比如在提交多少次后,想做一个总结.这时候可以把前面几个合并成一个提交信息. 进入到cookbook项目,并切换到squash-branch分支. [email protected] MINGW64 ~/cookbook/cookbook (rebase-branch)$ git checkout -b squash-branchSwitched to a new branch 'squash-branch' 在squash-branch分

oralce11gR2的安装 在 CentOS 6.6上的安装

环境要求: rlwrap-0.42  CentOS release 6.6 (Final) VMware Workstation 11  linux.x64_11gR2_database_1of2和linux.x64_11gR2_database_1of2 rlwrap的下载地址: http://utopia.knoware.nl/~hlub/uck/rlwrap/#rlwrap CentOS release 6.6  选择Basic Server其它没有什么特别要求: VMware Works

在centos 6.9 上rpm安装mysql

环境: Linux:CentOS release 6.9 64bit MySQL: mysq-5.7.18 1.在/home创建mysql目录,下载如下四个软件包 http://mirrors.sohu.com/mysql/MySQL-5.7/ wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-community-client-5.7.18-1.el6.x86_64.rpm wget http://mirrors.sohu.com/mysql/

CentOS 6.3上SVN安装过程及使用手册

一. SVN 简介 Subversion(SVN) 是一个开源的版本控制系統, 也就是说 Subversion 管理着随时间改变的数据. 这些数据放置在一个中央资料档案库 (repository) 中.这个档案库很像一个普通的文件服务器, 不过它会记住每一次文件的变动. 这样你就可以把档案恢复到旧的版本, 或是浏览文件的变动历史. SVN中经常用到的一些概念 : (1)repository(源代码库):源代码统一存放的地方: (2)Checkout (提取):当你手上没有源代码的时候,你需要从r

CentOS 7.1使用yum安装MySql5.6.24

原文地址:https://typecodes.com/web/centos7yuminstallmysql5.html?utm_source=tuicool&utm_medium=referral 在前面两篇文章<2015博客升级记(四):CentOS 7.1编译安装MySQL5.7.7rc>和<阿里云CentOS 7.1编译安装MySql5.6.24>中,都是采用编译MySQL源码的方式安装的,过程相对比较复杂.所以,这篇文章演示如何使用yum的方式安装MySql5.6.

[moka同学摘录]在Centos 6.5下成功安装和配置了vim7.4

来源:https://my.oschina.net/gzyh/blog/266097 摘要: 利用vmware安装了centos 6.5,并在网友的资料帮助下成功安装并配置了vim 7.4. 在这儿记录一下输入的命令. 开始学习一下Linux知识,用vmware安装了一个centos系统,在windows下习惯用vim7.4,所以也想在centos  6.5上也安装这个编辑器,决定做了,就在网上找相关资料. 参照了:http://blog.chinaunix.net/uid-29550914-i

Gitlab管理网页老是500错误?增加物理内存吧

上一篇 CentOS 7 系统下 GitLab 搭建 搭建时,是用的是1G内存, 访问gitlab管理网页非常慢,常常出现 500错误 查询后发现:Gitlab的运行对内存是有要求的:Memory 4GB 物理内存 支持100用户,也是 官方推荐 的配置. 参考文档:https://www.cnblogs.com/gnool/p/6128546.html 之前搭建的gitlab在 192.168.1.30上,因为这台机器上装了很多应用,所以换机器安装gitlab. 我选择的方式是 1. 直接cl