gitlab-ce 15部署

本文介绍了在RockyLinux9.1环境下,如何通过yum安装Gitlab-ce的详细过程,包括解决依赖问题、关闭防火墙、配置外部URL、数据目录、备份路径以及HTTPS设置,并提供了启动和查看Gitlab密码、版本的方法。
摘要由CSDN通过智能技术生成

Gitlab部署

  • gitlab rpm包下载链接:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/

  • 系统环境:Rocky Linux9.1

# 安装依赖包,libcrypt.so.1默认是glibc提供,升级到9后由libxcrypt-compat提供:/opt/gitlab/embedded/bin/ruby: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory
	yum -y install libxcrypt-compat

# 语言依赖缺少:WARN: Please install an English UTF-8 locale for Cinc Client to use, falling back to C locale and disabling UTF-8 support.
	yum -y install langpacks-en glibc-langpack-en
	
# 安装gitlab-ce
	yum -y localinstall gitlab-ce-15.6.7-ce.0.el8.aarch64.rpm

# 关闭防火墙
	systemctl disable firewalld --now
	sed -ri "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/sysconfig/selinux
	setenforce 0
	
# 开启相关服务
	systemctl enable postfix --now
	systemctl enable sshd -now
	
# 设置访问地址 vim /etc/gitlab/gitlab.rb
	external_url 'http://192.168.0.13

# 设置数据目录
git_data_dirs({
  "default" => {
    "path" => "/data/gitlab"
   }
})

# 设置备份目录
gitlab_rails['manage_backup_path'] = true
gitlab_rails['backup_path'] = "/data/gitlab-backup"

# 关闭Prometheus(测试环境不需要这个,减少资源消耗)
prometheus['enable'] = false
alertmanager['enable'] = false
node_exporter['enable'] = false
redis_exporter['enable'] = false
postgres_exporter['enable'] = false
gitlab_exporter['enable'] = false

# 设置HTTPS
	mkdir -p /etc/gitlab/ssl && chmod 700 /etc/gitlab/ssl && cd /etc/gitlab/ssl

# 创建服务器私钥,不加密
	openssl genrsa -out rsa_private.key 1024

# 生成RSA公钥
	openssl rsa -in rsa_private.key -pubout -out rsa_public.key

# 使用RSA私钥生成自签名证书
	openssl req -new -x509 -days 3650 -key rsa_private.key -out cert.crt

# gitlab https配置
nginx['enable'] = true
nginx['redirect_http_to_https'] = true
nginx['redirect_http_to_https_port'] = 80
nginx['ssl_certificate'] = "/etc/gitlab/ssl/cert.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/rsa_private.key"

# 生产配置文件
	gitlab-ctl reconfigure

# 启动gitlab
	gitlab-ctl start

# 查看gitlab密码
	cat /etc/gitlab/initial_root_password
	
	
# 查看gitlab版本
	head -1 /opt/gitlab/version-manifest.txt

登录

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

旺仔_牛奶

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值