gitlab 安装

前言: 原本想离线安装的,但是安装时一直报错,无奈选择了另一种方式。
离线安装包地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/

linux版本

1.配置依赖包

#更新一下 
#yum install -y epel-release
#gitlab-ce 对 curl policycoreutils openssh-server openssh-clients postfix 这些服务有依赖,需要提前安装和开启防火墙要打开 http 的访问,否则无法对外提供服务
yum install curl policycoreutils openssh-server openssh-clients

systemctl enable sshd
systemctl start sshd
yum install postfix
systemctl enable postfix
systemctl start postfix
#关闭防火墙,自己看需要,一般是开放某个端口,自己测着玩就可以关
#firewall-cmd --permanent --add-service=http
#systemctl reload firewalld

2.安装

yum list all | grep gitlab
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
yum list all | grep gitlab
yum install gitlab-ce

随后一路 y ,出现如下界面就是安装成功了
在这里插入图片描述

3.配置gitlab访问路径 及 启动gitlab

#修改配置
vim  /etc/gitlab/gitlab.rb

在这里插入图片描述

#gitlab-ctl status
#这个执行起来有点久,耐心等一下
gitlab-ctl reconfigure
#启动
gitlab-ctl restart

在这里插入图片描述

4.账号密码

#默认账号root 密码在
cat /etc/gitlab/initial_root_password

在这里插入图片描述

5.访问前面配置的ip

在这里插入图片描述

  • 修改密码
    在这里插入图片描述
    在这里插入图片描述

rpm方式: (再另一台虚拟机使用了该方式,可以正常部署)
gitlab rpm包安装方法
当前安装方式适合centOs7版本,需要有root权限,如果当前用户不是root用户,需要配置当前用户的sudo

  1. yum install -y curl policycoreutils-python openssh-server
  2. systemctl enable sshd && systemctl start sshd
  3. firewall-cmd --permanent --add-service=http
    在执行这条命令后如果报FirewallD is not running这个错误,说明防火墙没有启动,使用systemctl start firewalld启动防火墙
  4. firewall-cmd --permanent --add-service=https
  5. 指定一个端口作为后续在web端访问gitlab的端口并且打开这个端口对外访问。
    5.1. firewall-cmd --zone=public --list-ports 查询当前都有哪些端口可以通过外部访问
    5.2. firewall-cmd --zone=public --add-port=80/tcp --permanent 打开你需要打开的端口
  6. systemctl reload firewalld 重启防火墙
  7. yum install postfix 安装邮件服务
  8. systemctl enable postfix && systemctl start postfix
  9. 使用rpm包安装命令安装gitlab的rpm包,下载地址为https://packages.gitlab.com/gitlab/gitlab-ce社区版本或者使用清华大学镜像https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
    rpm -ivh …rpm
  10. vim /etc/gitlab/gitlab.rb 修改文件中的external_url ‘http://本机ip:端口’,改为可以访问到的地址和端口
  11. gitlab-ctl reconfigure:初始化gitlab配置信息并启动每一个组件,
    接下来就可以在web浏览器端进行访问了。

gitlab的初始化账号为root,密码为:5iveL!fe

gitlab常用命令

  1. gitlab-ctl start:启动gitlab,
  2. gitlab-ctl stop:停止gitlab。
  3. gitlab-ctl status:查看gitlab状态
  4. gitlab-ctl restart:重启服务
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值