在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 ` 使配置生效)
相关推荐
HABuo4 小时前
【Linux进程(四)】进程切换&环境变量深入剖析
linux·运维·服务器·c语言·c++·ubuntu·centos
Shanxun Liao8 小时前
CentOS 7.9 根分区 / 已经 100% 用满隐藏占用解决办法
linux·运维·centos
云动课堂12 小时前
【运维实战】企业级Samba文件共享服务 · 一键自动化部署方案 (适配银河麒麟 V10 /openEuler /CentOS)
运维·centos·自动化
oMcLin13 小时前
如何在CentOS Stream 9上通过配置Hyper‑V虚拟化实现高效的资源隔离与虚拟机管理?
linux·运维·centos
tianyuanwo1 天前
深入解析CentOS 8网络配置:NetworkManager DNS管理机制与网卡类型深度剖析
linux·网络·centos
tianyuanwo1 天前
深入解析CentOS 8中NetworkManager重启后DNS配置被覆盖的机制与解决方案
linux·运维·centos·dns
Dragon~Snow1 天前
Linux-centOS Stream 9 系统 mysql-8.4.7 RPM版本
linux·mysql·centos
慧一居士1 天前
Gitea和GitLab对比
运维·gitlab·gitea
oMcLin2 天前
如何在 CentOS Stream 9 上配置并优化 PostgreSQL 15,支持高并发的数据插入与快速查询?
linux·postgresql·centos
企鹅郁金香2 天前
Gitlab和Gerrit部署后的工作(二)
数据库·gitlab·gerrit域名无法修改·激活gitlab·gitlab注册ldap·nginx反向代理gitlab·nginx反向代理gerrit