阿里云-linux-服务器Java环境部署(四)-Linux-GitLab安装及汉化


关于GitLab的安装,按此文章步骤十分钟解决,灰常好用。以下完全复制于此文章,仅为做个备份,如有侵权即刻删除。

gitlab官网:https://about.gitlab.com/

gitlab国内镜像:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/


gitlab私服搭建

安装gitlab

安装环境:

(1)阿里云linux
(2)2G内存
(3)安装包:gitlab-ce-10.2.2-ce
(4)禁用防火墙,关闭selinux

安装步骤:

yum install -y curl policycoreutils-python openssh-server #安装依赖
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.2.2-ce.0.el7.x86_64.rpm #下载软件包
rpm -ivh gitlab-ce-10.2.2-ce.0.el7.x86_64.rpm    #安装gitlab

执行即可,无任何岔路。出现下图安装成功。
在这里插入图片描述
(2)根据安装完成提示界面进行访问URL更改及重新加载配置文件 更改次选项为自己的域名或者IP external_url ‘http://gitlab.example.com’

vim /etc/gitlab/gitlab.rb      #编辑配置文件  
external_url 'http://192.168.1.21:8444'        #改为自己的IP地址
gitlab-ctl reconfigure    #重新加载配置文件,这一步时间比较长,等一会

可以加ip:端口也可以加域名,记得一定要在阿里云管理平台的安全组中开放端口。
(3)重装完成访问http://192.168.1.21,会首先叫更改密码(root用户),改完后登录。如下界面:
在这里插入图片描述
(4)汉化、

1、下载汉化补丁
 git clone https://gitlab.com/xhang/gitlab.git
 cd gitlab    
2、查看全部分支版本
 git branch -a
3、对比版本、生成补丁包
 git diff remotes/origin/10-2-stable remotes/origin/10-2-stable-zh > /tmp/10.2.2-zh.diff
4、停止服务器
 gitlab-ctl stop
5、打补丁
 patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < /tmp/10.2.2-zh.diff
6、启动和重新配置
 gitlab-ctl start
 gitlab-ctl reconfigure

汉化完成后再次刷新页面如下:
在这里插入图片描述
Gitlab相关操作及说明:

/etc/gitlab/gitlab.rb          #gitlab配置文件
/opt/gitlab                    #gitlab的程序安装目录
/var/opt/gitlab                #gitlab目录数据目录
/var/opt/gitlab/git-data       #存放仓库数据
gitlab-ctl reconfigure         #重新加载配置
gitlab-ctl status              #查看当前gitlab所有服务运行状态
gitlab-ctl stop                #停止gitlab服务
gitlab-ctl stop nginx          #单独停止某个服务
gitlab-ctl tail                #查看所有服务的日志

Gitlab的服务构成:
nginx:                 静态web服务器
gitlab-workhorse        轻量级反向代理服务器
logrotate              日志文件管理工具
postgresql             数据库
redis                  缓存数据库
sidekiq                用于在后台执行队列任务(异步执行)

至此,gitlab私服搭建完成。

附加:linux 安装git服务

  1. 自动安装法:
yum -y install git

yum安装git被安装在/usr/libexec/git-core目录下

  1. 手动下载法
1.安装依赖环境
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
2.下载并解压源码
wget https://github.com/git/git/archive/v2.3.0.zip
unzip v2.3.0.zip
cd git-2.3.0
提示,安装编译源码所需依赖的时候,yum自动帮你安装了git,这时候你需要先卸载这个旧版的git。
yum -y remove git
3 编译 安装(如果没有权限就加上sudo)
编译git源码 :make prefix=/usr/local/git all
安装git至/usr/local/git路径:make prefix=/usr/local/git install
4、添加环境变量
vim /etc/profile
export PATH=/usr/local/git/bin:$PATH
source /etc/profile
如果成功显示版本号表示添加成功
git --version
git version 2.3.0
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值