使用rpm搭建Gitlab
本人使用的是Centos 7.9 X86的系统
1.安装依赖
yum install -y curl policycoreutils-python openssh-server
2.下载镜像文件并上传至服务器
国内镜像地址:
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
我这里采用的是这个源中最新的版本
3.安装Gitlab
可在 /usr/local/gitlab/ 中上传包
rpm -i gitlab-ce-15.2.2-ce.0.el7.x86_64.rpm
4.配置Gitlab
vi /etc/gitlab/gitlab.rb
主要涉及改动:
external_url 'http://192.168.1.77' # 改为自己的IP地址
修改端口
5.启动Gitlab
gitlab-ctl reconfigure # 重新加载配置文件,每次改动配置文件都需要执行
5.1 Gitlab基本命令
gitlab-ctl start # 启动gitlab
gitlab-ctl stop # 停止gitlab
gitlab-ctl restart # 重新启动gitlab
gitlab-ctl reconfigure # 重新加载配置文件
gitlab-ctl tail # 查看gitlab日志
6.访问Gitlab
192.168.1.77:8090