Centos7 安装私有 Gitlab

在 CentOS 7上,下面的命令也会在系统防火墙中打开 HTTP、HTTPS 和 SSH 访问。这是一个可选步骤,如果您打算仅从本地网络访问极狐GitLab,则可以跳过它。

复制代码
sudo yum install -y curl policycoreutils-python openssh-server perl
sudo systemctl enable sshd
sudo systemctl start sshd

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld

(可选)下一步,安装 Postfix 以发送电子邮件通知。如果您想使用其他解决方案发送电子邮件,请跳过此步骤并在安装极狐GitLab 后++配置外部 SMTP 服务器++。

复制代码
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

下载/安装极狐GitLab

配置极狐GitLab 软件源镜像。

复制代码
curl -fsSL https://packages.gitlab.cn/repository/raw/scripts/setup.sh | /bin/bash

执行命令安装

复制代码
sudo EXTERNAL_URL="http://192.168.110.60:8100" yum install -y gitlab-jh

地址设置成你本机的 ip 地址,后续通过本 ip:port --- http://192.168.110.60:8100 访问登录界面

下载安装过程时间较长,内心等待即可。

Tips:若安装完成后启动访问界面提示 502,多半原因是端口冲突导致。

gitlab 默认的配置文件路径为 /etc/gitlab/gitlab.rb

若前期EXTERNAL_URL设置错误可以直接修改本文件中对应的值

修改配置完成后执行命令

复制代码
sudo gitlab-ctl reconfigure

修改 root 账号密码

复制代码
cd /opt/gitlab/bin/    #gitlab铡疹臂隘
gitlab-rails console   #恋幼 gitlab 谤悬明 
==========================================================
u=User.find(1)         #汹漠root便肮
u.password='娱瘾'       #纵捶鹏傻  啃钓猛舱苞腔gitlab管凑笛别秃
u.save!                #泼弊希缎
exit                   #摄法瞄拿裤
==========================================================
gitlab-ctl restart     #怯郭gitlab,病步镀莫魏顿估臊浴root 虹坷强如锄
相关推荐
CAFEBABE 341 小时前
linux离线安装docker并启动
linux·docker·eureka
OnlyEasyCode3 小时前
快速上手!查看、拷贝、编辑、远程连接Linux命令
linux·运维·服务器
dualven_in_csdn3 小时前
UDP广播接收小优化
linux·运维·服务器
Xの哲學4 小时前
Linux二层转发: 从数据包到网络之桥的深度解剖
linux·服务器·算法·架构·边缘计算
石像鬼₧魂石4 小时前
Termux ↔ Windows 靶机 反向连接实操命令清单
linux·windows·学习
啃火龙果的兔子4 小时前
如何将D:\BaiduNetdiskDownload所有目录下的所有图片复制提取到D:\bacPic
linux·运维·服务器
FF-Studio4 小时前
RTX 5060 Ti Linux 驱动黑屏避坑指南:CUDA 13.1, Open Kernel 与 BIOS 设置
linux·运维·服务器·cuda
坐吃山猪5 小时前
BrowserUse14-源码-ScreenShot模块-整理
linux·数据库·python
Jelly-小丑鱼5 小时前
Linux搭建syslog日志服务器
linux·服务器·docker·日志服务器·syslog服务器
yilan_n5 小时前
在Linux下使用Termony搭建HNP自验证环境全指南
linux·harmonyos·termony·hnp·命令行适配