下载Github安装包
清华大学开源软件镜像站:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
选个稳定的版本,笔者选择的是 gitlab-ce-10.6.4-ce.0.el7.x86_64.rpm 这个版本
注意,最新版本目前还无汉化包
下载镜像:
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.6.4-ce.0.el7.x86_64.rpm
如果网速不好,可以先在本地下载后上传。
安装SSH协议
yum install -y curl policycoreutils-python openssh-server
设置SSH服务开机自启动
systemctl enable sshd
启动SSH服务
systemctl start sshd
添加HTTP服务到firewalld
firewall-cmd --permanent --add-service=http
添加HTTPS服务到firewalld
firewall-cmd --permanent --add-service=https
重启防火墙
systemctl reload firewalld
安装Postfix以发送通知邮件
yum install postfix
将postfix服务设置成开机自启动
systemctl enable postfix
启动postfix
systemctl start postfix
1、安装rpm包
rpm -ivh gitlab-ce-10.6.4-ce.0.el7.x86_64.rpm
2、修改配置文件
#编辑配置文件
vim /etc/gitlab/gitlab.rb
#修改访问URL
#格式:external_url 'http://ip:端口'
external_url 'http://192.168.1.222:8080'
#配置时区
gitlab_rails['time_zone'] = 'Asia/Shanghai'
url也可在安装是进行配置,参考官方文档
https://about.gitlab.com/install/#centos-7
3、防火墙开放端口
# 开放8080端口
firewall-cmd --zone=public --add-port=8080/tcp --permanent
4、重启防火墙
firewall-cmd --reload
5、查看端口号是否开启
firewall-cmd --query-port=8080/tcp
6、重置Gitlab
gitlab-ctl reconfigure
7、启动Gitlab
gitlab-ctl restart
如果出现502,可以使用如下两个命令试下
sudo gitlab-ctl restart sidekiq
sudo gitlab-ctl hup unicorn
也可能是端口冲突,查看端口是否被占用
netstat -tnlp
下载:
git clone https://gitlab.com/xhang/gitlab.git -b v10.6.4-zh
安装
停止服务
[root@localhost ~]# gitlab-ctl stop #停止服务,否则会出错
进入汉化包目录
[root@localhost ~]# cd /root/gitlab
比较汉化标签和原标签,导出 patch 用的 diff 文件到/root下
[root@localhost gitlab]# git diff v10.6.4 v10.6.4-zh > ../10.6.4-zh.diff
将10.6.4-zh.diff作为补丁更新到gitlab中
[root@localhost gitlab]# cd
[root@localhost ~]# patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 10.6.4-zh.diff
重新配置并启动gitlab
[root@localhost ~]# gitlab-ctl reconfigure #重新配置gitlab
[root@localhost ~]# gitlab-ctl start