首頁  >  文章  >  電腦教學  >  centos離線安裝中文版GitLab

centos離線安裝中文版GitLab

PHPz
PHPz轉載
2024-02-19 11:36:18906瀏覽

1. 下載gitlab安裝套件

從【清華大學開源軟體鏡像站 】下載最新中文版gitlab安裝包,安裝包裡自帶了簡體中文漢化包。

從【gitlab官網 】 下載gitlab最新安裝包。

centos離線安裝中文版GitLab

#2. 安裝gitlab

#以 gitlab-ce-14.9.4-ce.0.el7.x86_64為例,上傳至centos伺服器

使用yum安裝gitlab

#
yum -y install gitlab-ce-14.3.2-ce.0.el7.x86_64.rpm

centos離線安裝中文版GitLab

centos離線安裝中文版GitLab

##使用yum安裝git

#
yum -y install git #安装git

centos離線安裝中文版GitLab

#修改gitlab設定檔

#
vim /etc/gitlab/gitlab.rb

centos離線安裝中文版GitLab

#修改對外存取的網域或IP:

# 修改 external_url 'example.gitlab.com' 这一句
external_url 'http://192.168.150.102:8899'#修改成你自己的IP或域名:端口

注意:這裡設定的端口不能被佔用,預設是8080端口,如果8080已經使用,請自訂其它端口,並在防火牆設定開放範圍內的端口。

重新載入設定

gitlab-ctl reconfigure     #重新生成相关配置文件,执行此命令时间比较长

注意:重新產生相關設定文件,執行此指令時間比較長

設定gitlab開機自動啟動

#
systemctl enable gitlab-runsvdir.service
systemctl start gitlab-runsvdir.service

啟動GitLab

#
systemctl stop firewalld #关掉防火墙,要不然9091端口不能对外访问
gitlab-ctl restart #重启gitlab

centos離線安裝中文版GitLab

#
用户名: root

預設密碼讀取

cat /etc/gitlab/initial_root_password

centos離線安裝中文版GitLab

#修改密碼方式

centos離線安裝中文版GitLab

#修改密碼方式2

#
cd /opt/gitlab/bin
sudo gitlab-rails console -e production
u=User.where(id:1).first # u定义为root用户
u.password='zbbmeta' # 设置root密码, 注意需要符合密码强度
u.password_confirmation='zbbmeta' # 确认当前密码
u.save! # 保存操作
quit # 退出交互界面

設定為簡體中文

#先登入GitLab,登入成功後,在Gitlab後台的系統設定裡設定簡體中文。

設定路徑:Setting–>Preferences–>Language ,將字元集修改為簡體中文。

centos離線安裝中文版GitLab

centos離線安裝中文版GitLab

##注意:不要忘記點擊儲存

以上是centos離線安裝中文版GitLab的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:mryunwei.com。如有侵權,請聯絡admin@php.cn刪除