CentOS 7 使用rpm包搭建GitLab服务器

本文介绍在CentOS7系统搭建GitLab的详细步骤。包括安装依赖软件、开启支持发信功能的postfix并设置开机自启、安装防火墙、安装GitLab(可自选镜像地址)、修改访问地址和存储位置并执行配置,最后启动GitLab并设置开机自启。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、安装依赖软件

yum -y install policycoreutils openssh-server openssh-clients postfix

2、开启postfix

postfix支持gitlab发信功能,设置postfix开机自起

systemctl enable postfix && systemctl start postfix

3、安装防火墙

yum install firewalld systemd -y
service firewalld  start
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld

4、安装GitLab

镜像地址可以自己选择 【点击选择镜像】

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

yum install policycoreutils-python

rpm -ivh gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

5、修改访问地址和存储位置

vim /etc/gitlab/gitlab.rb


external_url http://IP:端口    //修改访问地址

unicorn['port'] = 8001    //unicorn worker的工作端口

执行配置

gitlab-ctl reconfigure

6、启动

gitlab-ctl start   #启动

gitlab-ctl restart  #重启

启动成功

设置开机自启

//开机自启
systemctl enable gitlab-runsvdir.service


//取消开机自启
systemctl disable gitlab-runsvdir.service

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值