centos7安装gitlab

本文详细介绍了在CentOS 7系统上安装GitLab的过程,包括安装依赖软件、配置服务器IP及端口、防火墙设置等步骤。此外,还提供了GitLab汉化的具体操作流程。

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

  1. 安装依赖软件

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

2.设置postfix开机自启,并启动,postfix支持gitlab发信功能

systemctl enable postfix && systemctl start postfix

3.下载gitlab安装包,然后安装

centos 7系统的下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7

下载:
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.3.5-ce.0.el7.x86_64.rpm
安装:
rpm -i gitlab-ce-12.3.5-ce.0.el7.x86_64.rpm

3、修改gitlab配置文件指定服务器ip和自定义端口:

命令:vim /etc/gitlab/gitlab.rb

external_url ‘http://106.2.20.152:9090’

配置时区

gitlab_rails[‘time_zone’] = ‘Asia/Shanghai’

4、将9090端口添加到防火墙中

命令: firewall-cmd --zone=public --add-port=9090/tcp --permanent

5、重启防火墙

重启命令: systemctl reload firewalld

6、重置gitlab

命令:gitlab-ctl reconfigure

7、启动gitlab

命令:gitlab-ctl restart

启用 Gitlab 开机自启动:

systemctl enable gitlab-runsvdir.service

三、汉化
1、安装git

yum install -y git

2、下载汉化包,其中v12.3.5-zh是版本,我的下载目录是root

git clone https://gitlab.com/xhang/gitlab.git -b v12.3.5-zh

3、停止gitlab服务

gitlab-ctl stop

4、切换到gitlab汉化包所在的目录

cd /root/gitlab

5、比较汉化标签和原标签,导出 patch 用的 diff 文件到/root下

git diff v12.3.5 v12.3.5-zh > …/12.3.5-zh.diff

6、安装patch

yum install patch -y

8、将12.3.5-zh.diff作为补丁更新到gitlab中

patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 12.3.5-zh.diff

出现如下直接回车,跳过,这是因为补丁中有一些较新的文件,但是我们安装的gitlab并没有这个文件存在

9、启动gitlab

gitlab-ctl start

10、重新配置gitlab

gitlab-ctl reconfigure

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值