Linux系统CentOS6.9(7) gitlab搭建(汉化版本更新)


1.前期准备工作

#安装所需命令

sudo yum install curl openssh-server openssh-clients postfix cronie

#GitLab使用postfix发送邮件

sudo service postfix start

#设置postfix开机自启动

sudo chkconfig postfix on

 

2.rpm下载gitlab安装包

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

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

#国内下载镜像地址(https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/),根据自己的系统是6还是7进行选择,我的系统是6.9,我这里选择下载10.7.1版本,执行如下命令进行下载

wget https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-10.7.1-ce.0.el6.x86_64.rpm

 

 

3.安装gitlab安装包

#执行rpm(此步骤大概会卡顿,请耐心等待),执行完成后如下图所示

rpm -ivh gitlab-ce-10.7.1-ce.0.el6.x86_64.rpm

 

 

发现error

error: Failed dependencies:

        policycoreutils-python is needed by gitlab-ce-10.7.3-ce.0.el7.x86_64

安装环境

yum install policycoreutils-python

继续安装安装包

rpm -ivh gitlab-ce-10.7.1-ce.0.el6.x86_64.rpm

 

 

发现报错 centos6 和7 下载的包不同

warning: gitlab-ce-10.2.7-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY

/opt/gitlab/embedded/bin/ruby: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /opt/gitlab/embedded/lib/libruby.so.2.3)

/opt/gitlab/embedded/bin/ruby: /lib64/libc.so.6: version `GLIBC_2.17' not found (required by /opt/gitlab/embedded/lib/libruby.so.2.3)

warning: %posttrans(gitlab-ce-10.2.7-ce.0.el7.x86_64) scriptlet failed, exit status 1

包和系统版本不一致导致,注意!!!

 

 

安装成功!!!

 

4.修改gitlab配置文件

gitlab安装之后需要先设置访问的域名,即设置external_url为要访问的域名

vim /etc/gitlab/gitlab.rb

external_url 'http://laoliu.ltd'(自定义)

 unicorn['port'] = 6666(自定义,注意不要与在使用的其他端口冲突)

 

5. 初始化gitlab配置

gitlab-ctl reconfigure

 

6. 重启gitlab服务

gitlab-ctl restart

 

7.汉化阶段

点击后面的网址查看更多gitlab版本的汉化 https://gitlab.com/xhang/gitlab/tree/9-0-stable-zh

7.1. 查看安装的gitlab版本

cat /opt/gitlab/embedded/service/gitlab-rails/VERSION

7.2. 克隆汉化版本库(需要安装git yum -y install git )

git clone https://gitlab.com/xhang/gitlab.git

#或 Gitcafe.com 镜像,速度更快(不同版本库) git clone https://gitcafe.com/larryli/gitlab.git

or

git clone https://gitlab.com/larryli/gitlab.git

7.3.  导出汉化包

cd gitlab/

git diff v10.7.1 v10.7.1-zh >../10.7.1-zh.diff

gitlab-ctl stop

cd ../ (到上一级目录)

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

(patch -d 打补丁)(需要安装patch 命令 yum -y install patch)

7.4. 初始化gitlab配置

gitlab-ctl reconfigure

(注意更改nginx 监听端口)

7.5.  重启gitlab服务

gitlab-ctl restart


 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值