Gitlab部署流程

安装准备

需要开启ssh:(已开启可跳过)

复制代码
sudo systemctl status sshd
sudo systemctl enable sshd
sudo systemctl start sshd

防火墙开放http、https服务:(已关闭防火墙可跳过)

复制代码
sudo systemctl status firewalld
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld

rpm 包安装

下载地址:https://packages.gitlab.com/gitlab/gitlab-ce

编写安装脚本

复制代码
cd ~/bin

vim gitlab-install.sh

脚本内容如下:

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

sudo rpm -ivh /opt/software/gitlab-ce-16.2.1-ce.0.el7.x86_64.rpm

sudo yum install -y postfix

sudo systemctl enable postfix

sudo systemctl start postfix

修改脚本执行权限并执行

复制代码
chmod +x gitlab-install.sh
sh gitlab-install.sh

执行初始化

安装完成后,需要执行初始化

复制代码
sudo gitlab-ctl reconfigure

启停命令

复制代码
sudo gitlab-ctl start

停止命令

复制代码
sudo gitlab-ctl stop

重装需要彻底卸载

1 卸载gitlab

复制代码
 sudo rpm -e gitlab-ce-16.2.1-ce.0.el7.x86_64

2 删除gitlab文件

复制代码
sudo rm -rf /etc/gitlab
sudo rm -rf /var/opt/gitlab
sudo rm -rf /opt/gitlab

修改 root 密码

访问web界面:默认使用服务器80端口

账号root,密码将随机生成并在 /etc/gitlab/initial_root_password 中保存24 小时。

复制代码
sudo cat /etc/gitlab/initial_root_password

设置简体中文

在UserSettings 里的Preferences修改为中文。

相关推荐
Sumlll_7 小时前
Ubuntu系统下QEMU的安装与RISC-V的测试
linux·ubuntu·risc-v
猫头虎7 小时前
2025最新OpenEuler系统安装MySQL的详细教程
linux·服务器·数据库·sql·mysql·macos·openeuler
晚风吹人醒.9 小时前
SSH远程管理及访问控制
linux·运维·ssh·scp·xshell·访问控制·远程管理
Uncertainty!!10 小时前
Linux多用户情况下个别用户输入密码后黑屏
linux·远程连接
necessary65310 小时前
使用Clion查看linux环境中的PG源码
linux·运维·服务器
小猪佩奇TONY11 小时前
Linux 内核学习(14) --- linux x86-32 虚拟地址空间
linux·学习
Lam㊣12 小时前
Centos 7 系统docker:更换镜像源
linux·docker·centos
FL162386312912 小时前
win11+WSL+Ubuntu-xrdp+远程桌面闪退+黑屏闪退解决
linux·运维·ubuntu
石头53012 小时前
Kubernetes监控全栈解决方案:从零搭建Prometheus+Grafana监控体系
linux
ha204289419412 小时前
Linux操作系统学习记录之---TcpSocket
linux·网络·c++·学习