Centos7安装gitlab

Centos7安装gitlab

由于Centos6/7已经停止更新了,故gitlab官方不提供相应的安装指南

GitLab安装

安装必要的依赖,建议Linux机器的最低配置为4核8G,越大越好,机器的流畅性会越好。

python 复制代码
 yum install -y curl policycoreutils-python openssh-server postfix

关闭selinux和防火墙

python 复制代码
systemctl stop firewalld
setenforce 0
sed -i 's/^SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

安装方式1:外网下载安装脚本并执行安装

python 复制代码
sudo yum install -y curl policycoreutils-python openssh-server postfix

安装方式2:下载rpm包安装

python 复制代码
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-13.8.4-ce.0.el7.x86_64.rpm
rpm -i gitlab-ce-13.8.4-ce.0.el7.x86_64.rpm

亲测第二种方式快一些

安装成果结果

python 复制代码
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : gitlab-ce-17.7.7-ce.0.el7.x86_64                                                                                                                                                                                                                                                                                              1/1 
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

Help us improve the installation experience, let us know how we did with a 1 minute survey:
https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=17-7

  Verifying  : gitlab-ce-17.7.7-ce.0.el7.x86_64                                                                                                                                                                                                                                                                                              1/1 

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

Complete!

安装过程需要安装大量的软件,等待时间较久

初始化配置

GitLab默认的配置文件路径:/etc/gitlab/

  • /etc/gitlab/gitlab.rb:主配置文件,包含外部URL、仓库目录、备份目录等

  • /etc/gitlab/gitlab-secrets.json:(执行gitlab-ctl reconfigure命令行后生成),包含各类密钥的加密信息

初始化配置-修改域名

python 复制代码
cat /etc/gitlab/gitlab.rb |grep -v "#" |grep -Ev "^$"
external_url 'http://gitlab.example.com'
# 将这里的url修改为机器的IP地址,如果配置了hosts文件可不进行修改,能够正确解析到后端IP地址即可

重新应用配置文件

python 复制代码
gitlab-ctl reconfigure

这里会重新进行编译,和一开始安装同样,需要等待较长时间

登录

浏览器访问 external_url 即可进行首次登录。首次登录需要设置密码,然后就可以正常使用了

相关推荐
羑悻的小杀马特6 小时前
【Linux篇章】再续传输层协议UDP :从低可靠到极速传输的协议重生之路,揭秘无连接通信的二次进化密码!
linux·运维·服务器·后端·网络协议·udp
无痕melody7 小时前
飞牛nas修改crontab计划默认编辑器
运维·编辑器
Linux运维技术栈8 小时前
Linux系统部署:Certbot 实现 Nginx 自动续期&部署 Let‘s Encrypt 免费 SSL 证书
linux·运维·nginx·ssl·certbot
阿雄不会写代码8 小时前
wecross 报错这个文件找不到 tassl-1.1.1b-linux-x86_64.tar.gz
linux·运维·服务器
关关长语11 小时前
Windows 安装配置解压版Mysql8.4.5
运维·windows·mysql
007php00714 小时前
Go 错误处理:用 panic 取代 err != nil 的模式
java·linux·服务器·后端·ios·golang·xcode
wypywyp14 小时前
linux基础——UDP、TCP
linux·tcp/ip·udp
孙克旭_15 小时前
day082-初识ElasticStack
linux·运维·elasticsearch
爱奥尼欧16 小时前
【Linux】系统部分——ELF文件格式与动态库加载
linux·运维·服务器