CentOS7.4搭建GitLab

本文详细介绍了在服务器上安装GitLab的过程,包括环境检查、下载安装包、解决依赖问题、配置外部URL等关键步骤,适合初次部署GitLab的用户参考。

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

1、查看服务器环境

uname -a

2、下载安装包

【1】找到相应的最新版本的下载路径

网址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/?C=M&O=D

 

 

我们得到下载路径:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.4.6-ce.0.el7.x86_64.rpm

【2】准备文件夹

mkdir /home/soft/gitlab
cd /home/soft/gitlab
 
 

 

 【3】下载安装包

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

 

3、安装GitLab

【1】安装遇到报错

 

发现报错:

warning: gitlab-ce-11.4.6-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
error: Failed dependencies:
policycoreutils-python is needed by gitlab-ce-11.4.6-ce.0.el7.x86_64

 

 【2】检查postfix

rpm -qa|grep postfix
ps -e|grep postfix

发现postfix有安装包,如果没有去安装:

yum install postfix

这里有,但是没有启动,那我们就需要去启动

systemctl enable postfix
systemctl start postfix

这里enable成功,但是start 报错:

Job for postfix.service failed. See 'systemctl status postfix.service' and 'journalctl -xn' for deta

【3】解决postfix启动报错

 

vi /etc/postfix/main.cf


#取消这句的注释
inet_interfaces = all
#这句all改为ipv4
inet_protocols = ipv4

 

【4】启动postfix

#启动
systemctl start postfix.service
#查看状态
ps -ef | grep postfix
systemctl status postfix.service

【5】安装policycoreutils-python

yum install -y policycoreutils-python

【6】再次安装GitLab

rpm -i gitlab-ce-11.4.6-ce.0.el7.x86_64.rpm

 

 到这里,安装就算完成了。

4、配置GitLab

 

vim /etc/gitlab/gitlab.rb

修改external_url

 

执行

gitlab-ctl reconfigure

 

转载于:https://www.cnblogs.com/yybrhr/p/9988835.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值