搭建GitLab

GitLab通俗理解就是相当于个人版的GitHub,GitHub是将代码托管在公共服务期上的代码托管平台,而GitLab则是将代码托管在私有服务器上,所以GitLab更适合公司,团队的代码托管服务。

本文记录GitLab的搭建,搭建环境为CentOS 8 虚拟机。

  1. 安装依赖
# 安装依赖软件
yum install -y policycoreutils-python-utils policycoreutils openssh-server openssh-clients postfix

# 启动ssh服务并设置开机自启
systemctl enable sshd && systemctl start sshd

# 启动postfix服务并设置开机自启,postfix支持GitLab发信功能
systemctl enable postfix && systemctl start postfix

# 开放ssh以及http的防火墙并重新加载
firewall-cmd --add-service=ssh --permanent
firewall-cmd --add-service=http --permanent
firewall-cmd --reload
  1. 下载GitLab的rpm包
    清华镜像站下载GitLab的rpm包,然后使用一下命令安装
rpm -ivh gitlab-ce-13.6.3-ce.0.el8.x86_64.rpm (具体软件包名称可能会有差别)
  1. 修改GitLab配置
vi /etc/gitlab/gitlab.rb

# 更改GitLab访问链接和端口,默认端口为80,改为82
external_url 'http://192.168.66.100:82'
nginx['listen_port'] = 82
  1. 重载配置并启动gitlab
# 重载配置,需要一会时间
gitlab-ctl reconfigure

# 启动gitlab
gitlab-ctl restart
  1. 添加防火墙放行82端口
firewall-cmd --zone=public --add-port=82/tcp --permanent
firewall-cmd --reload
  1. 访问网页并且设置GitLab管理员密码
# 地址为http://IP:端口
http://192.168.66.100:82

# 设置完管理员密码后跳转到登录页面
# 用户名为root,密码为管理员密码
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值