centos764 gitlab 9.3.5版本安装及汉化

小编用的是centos 7 64bit 腾讯云服务器,基于最近小程序很火、微信很火,移动端很火就选了腾讯云的服务器。

  • 安装依赖软件 
    yum -y install policycoreutils openssh-server openssh-clients postfix
  • 设置postfix开机自启,并启动,postfix支持gitlab发信功能 
    systemctl enable postfix && systemctl start postfix
  • 下载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
  • 我用的系统是centos 7,所以我在https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7中下载了gitlab-9.3.6版本.
  • 下载RPM包并安装.
'wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-9.3.6-ce.0.el7.x86_64.rpm'
  • 1
  • 1
'rpm -ivh gitlab-ce-9.3.6-ce.0.el7.x86_64.rpm'
  • 1
  • 1
  • 修改gitlab配置文件指定服务器ip和自定义端口:
'vim  /etc/gitlab/gitlab.rb'
  • 1
  • 1

centos764 gitlab 9.3.5版本安装及汉化_第1张图片
退出并保存 
ps:注意这里设置的端口不能被占用,默认是8080端口,如果8080已经使用,请自定义其它端口,并在防火墙设置开放相对应得端口

  • 重置并启动GitLab
'gitlab-ctl reconfigure'
'gitlab-ctl restart'
  • 1
  • 2
  • 1
  • 2
ok: run: gitlab-git-http-server: (pid 3922) 1s
ok: run: logrotate: (pid 3929) 0s
ok: run: nginx: (pid 3936) 1s
ok: run: postgresql: (pid 3941) 0s
ok: run: redis: (pid 3950) 0s
ok: run: sidekiq: (pid 3955) 0s
ok: run: unicorn: (pid 3961) 1s
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

提示“ok: run:”表示启动成功

  • 访问 GitLab页面 
    如果没有域名,直接输入服务器ip和指定端口进行访问 
    初始账户: root 密码: ***** 
    第一次登录修改密码 
    centos764 gitlab 9.3.5版本安装及汉化_第2张图片
  • 设置gitlab发信功能: 
    发信系统用的默认的postfix,smtp是默认开启的,两个都启用了,两个都不会工作. 
    我这里设置关闭smtp,开启postfix 
    关闭smtp方法:
'vim /etc/gitlab/gitlab.rb'
  • 1
  • 1

修改 'gitlab_rails['smtp_enable'] = true 为 false'

centos764 gitlab 9.3.5版本安装及汉化_第3张图片 
修改后执行

'gitlab-ctl reconfigure'
  • 1
  • 1

登录并添加一个用户,我这里使用qq邮箱添加一个用户 
centos764 gitlab 9.3.5版本安装及汉化_第4张图片 
登录qq邮箱,可以收到邮件通知(如果收不到,请查看垃圾邮箱或者检查邮件是否被拦截并删除,如果有请添加到白名单并删除用户再重新添加用户就可以收到了,否则请检查邮件日志并做好相关设置 

centos764 gitlab 9.3.5版本安装及汉化_第5张图片
这里边会涉及到你在  /gitlab.rb改的域名,如果不改邮箱里是localhost
以上完成安装基本配置.

汉化过程

  • 查看版本
'cat /opt/gitlab/embedded/service/gitlab-rails/VERSION'
9.3.5
  • 1
  • 2
  • 1
  • 2

当前版本为v9.3.5,并确认汉化版本库是否包含该版本的汉化标签(-zh结尾),也就是是否包含 v9.3.5-zh

  • 下载汉化包并汉化

克隆汉化版本库,此处用了好久的时间,拉取这个分支,没有更好的办法,可以自行百度一下Git慢的解决方式

 'git clone https://gitlab.com/xhang/gitlab.git'
  • 1
  • 2
  • 1
  • 2

倘若出现

'-bash: git: command not found'
  • 1
  • 2
  • 1
  • 2
说明git 需要在安装一遍

如果已经克隆过,则进行更新

'git fetch'
  • 1
  • 1
  • 比较汉化标签和原标签,导出 patch 用的 diff 文件.进入刚才的目录git clone 的目录
'cd gitlab'
'git diff v9.3.5 v9.3.5-zh > ../9.3.5-zh.diff'
  • 1
  • 2
  • 1
  • 2
  • 上传 9.3.5-zh.diff文件到服务器停止 gitlab
'gitlab-ctl stop'
'patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < ../9.3.6-zh.diff'
  • 这里path 如果也出现 command not found 说明path安装包没有安装,然后在运行前边的代码就可以了
  • yum -y install patch 
  • 1
  • 2
  • 1
  • 2
  • 重启gitlab即可.
'gitlab-ctl start'
  • 1
  • 1
  • 执行重新配置命令
'gitlab-ctl reconfigure'
  • 1
  • 1

如果汉化中出现问题,请重新安装GitLab

  • 汉化后界面 
    centos764 gitlab 9.3.5版本安装及汉化_第6张图片

卸载

前提:必须在Gitlab运行状态下才能卸载

'gitlab-ctl uninstall' 
'rpm -e gitlab-ce'
  • 1
  • 2
  • 1
  • 2

在卸载gitlab然后再次安装执行gitlab-ctl reconfigure的时候往往会出现:ruby_block[supervise_redis_sleep] action run,会一直卡无法往下进行! 
解决方案:

  1. 按住CTRL+C强制结束

  2. 运行:

'systemctl restart gitlab-runsvdir'
'gitlab-ctl reconfigure'`

如果你对微信开发、小程序开发感兴趣欢迎加入我们


centos764 gitlab 9.3.5版本安装及汉化_第7张图片

小程序群

centos764 gitlab 9.3.5版本安装及汉化_第8张图片




你可能感兴趣的:(A01-Short,Key)