【Git系列】搭建 GitLab 服务器

GitLab 服务器搭建

1. 下载 rpm 安装包

下载 gitlab-ce-10.8.2-ce.0.el7.x86_64 这个版本的安装包

https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/

2. 将安装包上传到虚拟机的 /opt 目录下

注:虚拟机使用的是 CentOS 7 的系统版本

3. 执行官网的安装命令

sudo rpm -ivh /opt/gitlab-ce-10.8.2-ce.0.el7.x86_64.rpm
sudo yum install -y curl policycoreutils-python openssh-server cronie
sudo lokkit -s http -s ssh
sudo yum install postfix
sudo service postfix start
sudo chkconfig postfix on
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ce

注:上面我们使用的是GitLab的社区安装版,可以从上面执行的命令看出来

# gitlab-ce 就是社区版   gitlab-ee 就是发行版
sudo rpm -ivh /opt/gitlab-ce-10.8.2-ce.0.el7.x86_64.rpm
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ce

可以将上面的操作命令编写成一个 sh 脚本,便于执行,封装成脚本之后需要给脚本赋执行权限

chmod 755 脚本名称.sh

4. GitLab服务操作

# 1. 初始化配置 gitlab
gitlab-ctl reconfigure

# 2. 启动 gitlab 服务
gitlab-ctl start

# 3. 停止 gitlab 服务
gitlab-ctl stop

5. 访问GitLab

  1. 在浏览器中直接输入虚拟机IP地址即可(若访问不了查看下虚拟机防火墙有没有关闭)
# 若防火墙没有关闭可以执行下面命令将防火墙关闭
service firewalld stop
  1. 登陆的账号密码
账号:root
密码:首次登陆时会让你先设置一个登陆密码,长度为8个以上字符。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值