Linux安装GitLab-ce社区版并汉化

Git工具我们经常在开发中使用,作为代码管理,那具体在Linux中如何安装呢?

请参考以下步骤:

1安装必要的依赖项,配置SSH开机启动,系统防火墙中开放HTTP、HTTPS访问。

yum install -y curl policycoreutils-python openssh-server

systemctl enable sshd

systemctl start sshd

firewall-cmd --permanent --add-service=http

firewall-cmd --permanent --add-service=https

systemctl reload firewalld/

2安装Postfix以发送通知电子邮件,并配置开机启动。

如果要使用其他解决方案发送电子邮件,请跳过此步骤,并在安装GitLab后配置外部SMTP服务器。

yum install –y postfix

systemctl enable postfix

systemctl start postfix

3、获取gitlab rpm包

(清华镜像站)  https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/

找到对应版本。(也可以使用其他镜像站)

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

​

4、安装rpm包

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

5、安装 gitlab-ce

yum install -y gitlab-ce

6修改配置

vi /etc/gitlab/gitlab.rb

external_url 'http://服务器ip:9010'

unicorn['port'] = 9898

注意:这里踩了一个坑,必须放开这二个注释不然会打开页面会502

重启服务

user['username'] = "gitlab"

user['group'] = "gitlab"

gitlab-ctl reconfigure
gitlab-ctl restart

7访问gitlab

访问 http://安装的服务器ip:9010

例:http://127.0.0.1:9010

8、汉化下载汉化补丁

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

cd gitlab

9、查看全部分支版本

git branch -a

10对比版本、生成补丁包

git diff remotes/origin/10-2-stable remotes/origin/10-2-stable-zh > /tmp/10.2.2-zh.diff

11停止服务器

gitlab-ctl stop

12打补丁

patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < /tmp/10.2.2-zh.dif

13启动和重新配置

gitlab-ctl start

gitlab-ctl reconfigure

汉化完成后再次刷新页面即可

  • 12
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值