測試系統(tǒng)CentOS6.9,IP地址192.168.0.80
源碼編譯需要很多依賴璧眠,很容易出錯,此處直接選擇rpm包方式安裝
官方地址:https://about.gitlab.com/downloads
中文網(wǎng)站地址:https://www.gitlab.com.cn/downloads
Gitlab安裝
安裝所需依賴
yum -y install openssh-server cronie git wget patch
關(guān)閉防火墻玉工,關(guān)閉selinux(或者自行開放相應(yīng)端口lokkit -s http -s ssh)
service iptables stop
setenforce 0
下載所需rpm包
cd /usr/src/
wget https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-9.1.3-ce.0.el6.x86_64.rpm
rpm -ivh gitlab-ce-9.1.3-ce.0.el6.x86_64.rpm
注意:此處如果不是gitlab: GitLab should be reachable athttp://gitlab.example.com這句的話缚俏,可能會在初始化時有問題椰于,可以修改/etc/gitlab/gitlab.rb文件,改成external_url 'http://gitlab.example.com'然后在進(jìn)行初始化
初始化gitlab
gitlab-ctl reconfigure
查看服務(wù)
gitlab-ctl status
重啟仪搔、停止或啟動服務(wù)
gitlab-ctl restart/stop/start
配置文件目錄
/etc/gitlab/gitlab.rb
安裝完成瘾婿,可以通過瀏覽器訪問IP測試(如訪問不了,請檢查iptables、selinux)
首次訪問Gitlab需要設(shè)置管理員密碼偏陪,設(shè)置成功后會返回登錄頁面抢呆,默認(rèn)管理員帳號是root,如果想更改默認(rèn)管理員帳號笛谦,需要進(jìn)入系統(tǒng)后修改帳號名抱虐。
Gitlab漢化
Gitlab中文社區(qū)版地址:https://gitlab.com/xhang/gitlab
感謝漢化項(xiàng)目發(fā)起人@larryli,感謝@xhang繼續(xù)漢化本項(xiàng)目
先確認(rèn)當(dāng)前Gitlab版本
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
克隆版本庫(我在這里克隆時大概用了20分鐘)
cd /usr/src/
git clone https://gitlab.com/xhang/gitlab.git
比較原標(biāo)簽和漢化標(biāo)簽饥脑,導(dǎo)出patch用的diff文件
cd gitlab/
git diff v9.1.0 v9.1.0-zh > ../9.1.0-zh.diff
先停止gitlab
gitlab-ctl stop
上傳9.1.0-zh.diff文件到服務(wù)器
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < ../9.1.0-zh.diff
然后啟動gitlab
gitlab-ctl start