在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 ` 使配置生效)
相关推荐
银河麒麟操作系统2 天前
协同创新!国网河南电力闯出CentOS迁移新路径
linux·运维·centos·银河麒麟操作系统
亚那迦基14 天前
24小时高危漏洞速报,互联网惊天危机来临!PHP、Java、Node.js、NGINX、GitLab无一幸免,看看你家是否中招
nginx·gitlab·php
飞奔的瓜牛14 天前
CentOS 7 系统优化实战指南:从内核参数到服务精简
linux·运维·centos
考虑考虑14 天前
git刷新远程分支列表
git·后端·gitlab
wno70415 天前
CentOS下FTP服务搭建
linux·运维·centos
无足鸟ICT18 天前
【RHCA+】安装Tuned
linux·服务器·centos
2601_9679791219 天前
pip在Python中的9个必须知道的用法
python·pip·版本控制·包管理工具·requirements.txt
IT大白鼠22 天前
GitLab 未认证 RCE 应急实战CVE-2026-97229(CVSS 10.0)
网络·安全·gitlab
江屿风24 天前
【Git-组件】【Git入门:从文档灾难到版本掌控】流食般投喂
运维·笔记·git·组件·版本控制
2601_9679873725 天前
pycharm如何运行python代码
pycharm·版本控制·python代码·调试工具·运行环境