在CentOS7安装部署GitLab服务

CentOS 7 安装 Gitlab

官方安装教程:https://about.gitlab.com/install/

参考安装教程:https://developer.aliyun.com/article/74395

安装配置

Step1:配置yum源

shell 复制代码
vim /etc/yum.repos.d/gitlab-ce.repo

存入以下内容:

shell 复制代码
[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
Repo_gpgcheck=0
Enabled=1
Gpgkey=https://packages.gitlab.com/gpg.key

Step2:更新本地yum缓存

shell 复制代码
sudo yum makecache

Step3:安装GitLab社区版

shell 复制代码
sudo yum intall gitlab-ce        #自动安装最新版
sudo yum install gitlab-ce-x.x.x    #安装指定版本

Step4:启动Gitlab

shell 复制代码
gitlab-ctl reconfigure    # 仅加载新配置时需要执行此命令
gitlab-ctl start

Step5:登录并配置Gitlab

打开服务器本地浏览器,访问:127.0.0.1 地址,打开 Gitlab 管理后台,根据提示完成设置即可!

GitLab常用命令

shell 复制代码
sudo gitlab-ctl reconfigure    # 重新加载配置(主要用于修改/etc/gitlab/gitlab.rb文件后执行)
sudo gitlab-ctl start    # 启动 GitLab
sudo gitlab-ctl stop    # 停止 GitLab
sudo gitlab-ctl restart    # 重启 GitLab
sudo gitlab-ctl status    # 查看 GitLab 状态

sudo gitlab-ctl tail    # 查看日志
sudo gitlab-ctl tail postgresql    # 查看 postgresql 日志
sudo gitlab-ctl tail nginx/gitlab_acces.log    # 查看 nginx 访问日志
gitlab-rake gitlab:check SANITIZE=true --trace    # 检查gitlab

其它说明

复制代码
sudo vim /etc/gitlab/gitlab.rb        # 修改默认的配置文件(修改完成后,执行 `gitlab-ctl reconfigure ` 使配置生效)
相关推荐
小夏子_riotous1 天前
Docker学习路径——3、常用命令
linux·运维·服务器·学习·docker·容器·centos
uesowys1 天前
CentOS Linux安装部署OpenClaw
linux·centos·安装部署openclaw
aq55356002 天前
CentOS vs Debian:如何选择最适合的Linux发行版
linux·centos·debian
huanmieyaoseng10032 天前
centos 配置国内yum源2026新
linux·运维·centos
angushine3 天前
gitlab跨服务器备份
服务器·gitlab·github
杨云龙UP3 天前
CentOS7.9及以上环境部署TDengine TSDB-OSS实战指南:安装、配置、建库、建超级表与验证_20250418
大数据·linux·运维·数据库·centos·时序数据库·tdengine
蜡台4 天前
Git 常用配置:修改地址 ,提交模板配置
git·gitlab·template·git commit·gitbash
青城山下————4 天前
CentOS 7 安装 PostgreSQL 13(国内镜像 + 远程访问)完整实践教程
linux·postgresql·centos
青城山下————4 天前
CentOS 7(3.10 内核)成功安装 MySQL 5.7 全流程实践(附问题总结)
linux·mysql·centos
九天鸟4 天前
ESXI里面虚拟机服务器始终保持免用户认证状态
linux·运维·centos