Centos7安装Gitlab

该文详细介绍了在Linux系统中安装GitLab的步骤,包括安装必要依赖,配置GitLab软件源,下载并安装GitLab,设置初始管理员密码,以及如何登录和修改密码。此外,还提到了查看和管理GitLab服务状态的命令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装GithLab

1. 安装必要依赖

sudo yum install -y curl policycoreutils-python openssh-server perl 
sudo systemctl enable sshd 
sudo systemctl start sshd 
# 开启 http 端口:GitLab 默认端口
# 开启 https 端口:GitLab 默认端口
sudo firewall-cmd --permanent --add-service=http 
sudo firewall-cmd --permanent --add-service=https 
# 重载防火墙
sudo systemctl reload firewalld
# 查看防火墙已开放的端口与服务
sudo firewall-cmd --list-all

2. 配置GitLab软件源镜像

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash

在这里插入图片描述

3. 下载安装GitLab

sudo EXTERNAL_URL="http://192.168.0.180" yum install -y gitlab-ee

出现如图表示安装成功,可能需要多等几分钟
在这里插入图片描述

4. 查看管理员root用户默认密码

# 用户名为 root
sudo cat /etc/gitlab/initial_root_password

5. 登录GitLab

登录地址:http://192.168.0.180/users/sign_in

6. 修改密码

http://192.168.0.180/-/profile/password/edit

7. GitLab就安装完成了

8. 相关命令

#查看GItLab状态
sudo systemctl status gitlab-runsvdir.service
#停止GitLab
sudo systemctl stop gitlab-runsvdir.service
#GitLab开机自启状态
sudo systemctl list-unit-files | grep gitlab-runsvdir.service
#关闭GitLab开机自启动
sudo systemctl disable gitlab-runsvdir.service
#开启GitLab开机自启动
sudo systemctl enable gitlab-runsvdir.service
#查看GitLab各服务状态
sudo gitlab-ctl status
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值