Cài đặt GitLab trên CentOS 7 và Tiếng Việt Hóa

Chuẩn bị môi trường cơ bản

1. Cài đặt các gói phụ thuộc

[root@server-git ~]# yum install curl wget ssh-clients postfix git patch -y
[root@server-git ~]# systemctl enable postfix && systemctl start postfix

2. Thiết lập nguồn yum (khuyến nghị sử dụng nguồn mirror của Đại học Thanh Hoa cho người dùng trong nước)

[root@server-git ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirror.hust.edu.vn/centos/7/os/x86_64/
[root@server-git ~]# wget -P /etc/yum.repos.d/ http://mirror.hust.edu.vn/epel/7/x86_64/epel-release-latest-7.noarch.rpm
[root@server-git ~]# vim /etc/yum.repos.d/gitlab-ce.repo
[gitlab-ce]
name=GitLab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
gpgcheck=0
enabled=1
[root@server-git ~]# yum clean all && yum makecache fast

Lấy GitLab và gói tiếng Việt

[root@server-git ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-13.9.0-ce.0.el7.x86_64.rpm
[root@server-git ~]# git clone https://gitlab.com/lang-vi/gitlab.git -b v13.9.0-vi

Cài đặt GitLab

[root@server-git ~]# yum localinstall gitlab-ce-13.9.0-ce.0.el7.x86_64.rpm -y
[root@server-git ~]# vim /etc/gitlab/gitlab.rb
external_url 'http://192.168.1.105' # Đặt địa chỉ IP hoặc tên miền máy chủ
[root@server-git ~]# gitlab-ctl reconfigure
[root@server-git ~]# netstat -tuln | grep 80

Sau khi mở giao diện Web, thiết lập mật khẩu quản trị viên với ít nhất 8 ký tự.

Sau khi thay đổi, làm mới trang để thấy giao diện đăng nhập và đăng ký. Sử dụng tài khoản root để đăng nhập (trong môi trường sản xuất, nên tắt chức năng đăng ký).

Giao diện mặc định là tiếng Anh, có thể sử dụng gói tiếng Việt để chuyển đổi ngôn ngữ.

Cài đặt gói tiếng Việt

[root@server-git ~]# gitlab-ctl stop
[root@server-git ~]# cd /root/gitlab
[root@server-git gitlab]# git diff v13.9.0 v13.9.0-vi > ../13.9.0-vi.diff
[root@server-git gitlab]# cd
[root@server-git ~]# patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 13.9.0-vi.diff
[root@server-git ~]# gitlab-ctl reconfigure
[root@server-git ~]# gitlab-ctl start

Làm mới giao diện Web để kiểm tra kết quả tiếng Việt hóa.

Để bảo mật, hãy tắt chức năng đăng ký người dùng.

Chỉ còn lại giao diện đăng nhập!

Xem thêm yêu cầu phần cứng và phần mềm cho GitLab tại đây: Yêu cầu phần cứng

Hướng dẫn sử dụng lệnh Git: Tài liệu Git

Thẻ: CentOS gitlab linux Localization SystemAdministration

Đăng vào ngày 24 tháng 6 lúc 19:35