CentOS7/6 gitlab本地服务器搭建

1 篇文章 0 订阅

因为之前消耗三天,一直不能够成功安装部署gitlab服务器,究其原因,发现最先安装的VMware版本为精简版本,不具有全部VMware功能,当然与自身的win10系统不全也有问题,最后通过重装系统,重新在VMware官网下载的VMware,以及官网版xshell,最终完成gitlab服务器搭建,以下所有命令均为管理员命令,如果没有使用管理员权限请在每一行命令前添加sudo

 

 

环境准备

gitlab本地服务器搭建使用工具:VMware Workstation 14 Pro(14.1.2 build-8497320),Xshell,最新版gitlab-ce

接下来上干货:

1.     为了快速下载我们把其默认镜源像修改为阿里云源镜像。

首先备份系统自带yum源配置文件/etc/yum.repos.d/CentOS-Base.repo

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

 

2.     下载ailiyunyum源配置文件到/etc/yum.repos.d/
CentOS7

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 下划线处根据centos的版本修改。

3运行yum makecache生成缓存:

yum makecache 

4.更新系统:

yum -y update

安装

到这一步源镜像修改完成了,下面开始安装gitlab

阿里云官方给出两种方法安装,一种是镜像安装(付费),一种是手动安装,我们主要讲手动安装。

1.  配置yum源:vim /etc/yum.repos.d/gitlab-ce.repo

复制以下内容:

1.  [gitlab-ce]

2.  name=gitlab-ce

3.  baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6

4.  Repo_gpgcheck=0

5.  Enabled=1

6.  Gpgkey=https://packages.gitlab.com/gpg.key

下划线版本根据centos版本修改。

2.  更新本地yum缓存:yum makecache

3. 安装gitlab社区版,最新版本yum install gitlab-ce

安装指定版本yuminstall gitlab-ce-x.x.xxxx版本号)

4关掉虚拟机防火墙

//临时关闭

systemctl stop firewalld

//禁止开机启动

systemctl disablefirewalld

 

5.常用命令

1.  sudo gitlab-ctl start# 启动所有 gitlab 组件;

2.  sudo gitlab-ctl stop# 停止所有 gitlab 组件;

3.  sudo gitlab-ctl restart # 重启所有 gitlab 组件;

4.  sudo gitlab-ctl status # 查看服务状态;

5.  sudo gitlab-ctl reconfigure # 启动服务;

6.  sudo vim /etc/gitlab/gitlab.rb # 修改默认的配置文件;

7.  gitlab-rake gitlab:check SANITIZE=true--trace# 检查gitlab

8.  sudo gitlab-ctl tail

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值