在Linux下安装Gitlab

发布于:2025-04-18 ⋅ 阅读:(21) ⋅ 点赞:(0)

Cenos7下安装GitLab

在ssh下安装

官方安装文档:https://gitlab.cn/install/?version=ce

1. 使用阿里YUM 镜像云

下载

https://mirrors.aliyun.com/repo/Centos-7.repo

替换

/etc/yum.repos.d/CentOS-Base.repo

在目录/etc/yum.repos.d/下执行如下命令:

curl -o CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
更新镜像源目录
yum clean all
yum makecache
yum update

1. 安装依赖

yum install -y curl policycoreutils-python openssh-server perl
systemctl enable sshd
systemctl restart sshd

2. 配置镜像

curl -fsSL https://packages.gitlab.cn/repository/raw/scripts/setup.sh | /bin/bash

执行完成如下图
在这里插入图片描述

3. 开始安装

EXTERNAL_URL="http://192.168.1.110" yum install -y gitlab-jh

我的虚拟机是192.168.1.110
安装完成的内容如下图:
在这里插入图片描述

启动

gitlab-ctl start

在这里插入图片描述

访问web页面

http://192.168.1.110/users/sign_in

在这里插入图片描述

如果访问失败

如果访问失败可能存在的原因是防火墙,先考虑直接将防火墙停掉

systemctl stop firewalld

初始用户名密码

根据时候的提示
在这里插入图片描述
所以可以知道,用户名为:root,密码需要查看 /etc/gitlab/initial_root_password
我的密码如下:
在这里插入图片描述

Password: Mwc1hG/IZGQm//4H9zdo+uUg5vZNfzWRNSrxjGNWgHs=

修改密码

进入用户管理

修改用户密码信息修改一个8位长度的密码就好了,密码策略比较简单。比如我就修改一个:Aa1****6

gitlab常用命令

gitlab-ctl start
gitlab-ctl stop
gitlab-ctl restart
gitlab-ctl status
gitlab-ctl reconfigure
vi /etc/gitlab/gitlab.rb
gitlab-ctl tail                    # 查看日志

网站公告

今日签到

点亮在社区的每一天
去签到