CentOS 7 Omnibus 包安装 GitLab 并汉化记录

系统环境

操作系统:CentOS 7
GitLab:gitlab-ce-10.8.4-ce.0.el7.x86_64.rpm

下载Omnibus安装包

使用国内镜像加速下载地址

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

开始安装

1. 安装必要的依赖包

# yum install -y curl policycoreutils-python openssh-server

2. rpm安装

# rpm -ivh gitlab-ce-10.8.4-ce.0.el7.x86_64.rpm

rpm包默认安装在/opt/gitlab目录,运行目录为/var/opt/gitlab目录。

3. 修改配置文件

需要删除最前面的#才会生效

# vim /etc/gitlab/gitlab.rb
(1). 修改仓库git_data_dir存放位置
git_data_dirs({
	"default" => {
		"path" => "/data/gitlab/git-data"
	}
})
(2). 修改数据库postgresql['data_dir']存放位置
postgresql['data_dir'] = "/data/gitlab/postgresql/data"
(3). 修改自带Nginx监听的端口

因为服务器上已经安装了Nginx,因此修改默认端口。

nginx['listen_port'] = 81

使配置生效并启动GitLab

第一次启动因为要初始化,等待的时间会比较长

# gitlab-ctl reconfigure

查看运行状态

# gitlab-ctl status

配置Nginx转发

在原来的Nginx中配置GitLab访问地址

server {
	listen       80;
	server_name  localhost;
	location / {
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_pass http://127.0.0.1:81;
	}
}

重启Nginx

# /web/nginx/sbin/nginx -s reload

汉化GitLab

1. 安装 git

安装依赖包

# yum install curl-devel perl-ExtUtils-MakeMaker perl

下载最新版git安装包

# wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz

解压

# tar -xvf git-2.9.5.tar.gz

编译

# cd git-2.9.5
# ./configure && make && make install
# git --version

2. 下载汉化包并导出补丁

# git clone https://gitlab.com/xhang/gitlab.git
# cd gitlab
# git diff v10.8.0 v10.8.0-zh > ../v10.8.0-zh.diff

3. 安装补丁

停止GitLab服务
# gitlab-ctl stop
安装patch
# yum install patch
安装补丁,安装的时候可能会有文件找不到,忽略即可
# patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < v10.8.0-zh.diff
启动GitLab服务
# gitlab-ctl start

转载于:https://my.oschina.net/qinmei/blog/1835288

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值