在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 ` 使配置生效)
相关推荐
2601_961875245 天前
决战申论100题2026|最新|范文
linux·容器·centos·debian·ssh·fabric·vagrant
霸道流氓气质5 天前
GitLab CI/CD 完全指南
linux·ci/cd·gitlab
sbjdhjd5 天前
从零搭建企业级 CI/CD(下):Jenkins+GitLab+Harbor 全链路实战指南
git·servlet·ci/cd·云原生·云计算·gitlab·jenkins
wcy100865 天前
为 CentOS 7.6 (7.6.1810) 配置阿里云 Vault 源
linux·阿里云·centos
狮子再回头6 天前
relhat9.1 yum无法安装问题
linux·运维·centos
用什么都重名6 天前
Git 合并两个无共同历史的分支:从报错到解决全记录
git·gitlab
master3366 天前
GitLab (Docker) 常用命令及解决方案清单
docker·容器·gitlab
IT19956 天前
踩坑实录:CentOS 默认 Fail2Ban 挡不住高频并发攻击,漏洞修复一步到位
linux·运维·centos
摇滚侠6 天前
VMvare 安装 Linux CentOS 7
linux·运维·centos
qq_356408666 天前
GitLab 单机私有化部署文档(基于 Docker 环境)
docker·gitlab