新聞中心
GitLab 是一個(gè)用于倉(cāng)庫(kù)管理系統(tǒng)的開(kāi)源項(xiàng)目,使用Git作為代碼管理工具,并在此基礎(chǔ)上搭建起來(lái)的Web服務(wù)。安裝方法是參考GitLab在GitHub上的Wiki頁(yè)面,本篇文章重點(diǎn)為大家分享一下GitLab的安裝和簡(jiǎn)單使用。

安裝
以下為官方文檔的安裝說(shuō)明,詳細(xì)的信息請(qǐng)?jiān)L問(wèn) gitlab 官網(wǎng) 或者訪問(wèn)gitlab 中文網(wǎng)
1,安裝依賴
sudo yum install curl openssh-server openssh-clients postfix cronie
sudo service postfix start
sudo chkconfig postfix on
sudo lokkit -s http -s ssh
2,添加GitLab倉(cāng)庫(kù),并安裝到服務(wù)器上
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce
3,配置并啟動(dòng),以下命令會(huì)自動(dòng)配置并初始化 gitlab
sudo gitlab-ctl reconfigure
4,啟動(dòng)并登陸
以下是默認(rèn)用戶名密碼,首次登陸會(huì)提示你修改密碼:
Username: root
Password: 5iveL!fe
然后就可以愉快的折騰了!
GitLab的安裝實(shí)戰(zhàn)GitLab的安裝實(shí)戰(zhàn)
安裝中出現(xiàn)的問(wèn)題
聽(tīng)說(shuō) gitlab 安裝中會(huì)出現(xiàn)的問(wèn)題還是比較多的,不過(guò)在我安裝的過(guò)程中好像沒(méi)有遇到多少問(wèn)題!
1,在瀏覽器中訪問(wèn)GitLab出現(xiàn)502錯(cuò)誤
GitLab的安裝實(shí)戰(zhàn)GitLab的安裝實(shí)戰(zhàn)
首先就是端口占用問(wèn)題,gitlab 啟動(dòng)會(huì)使用 80 端口,所以建議你在啟動(dòng) gitlab 前先將不需要的服務(wù)都關(guān)掉,或者修改默認(rèn)端口:
sudo vim /etc/gitlab/gitlab.rb
修改external_url,直接增加端口號(hào)即可,比如我這里用8800端口:
external_url 'http://localhost:8800'
然后執(zhí)行:
sudo gitlab-ctl reconfigure
2,8080端口沖突
除了 80 這個(gè)端口外,還有一個(gè)unicorn用的端口,默認(rèn)是8080,如果8080端口被其他程序占用。那么unicorn就會(huì)無(wú)法啟動(dòng),顯示為502錯(cuò)誤,”GitLab is not responding”。
解決辦法:修改 /etc/gitlab/gitlab.rb
unicorn['listen'] = '127.0.0.1'
unicorn['port'] = 8801
然后運(yùn)行:
sudo gitlab-ctl reconfigur
gitlab 常用命令
gitlab-ctl start
gitlab-ctl stop
gitlab-ctl status
gitlab-ctl restart
Gitlab 默認(rèn)的日志文件存放在/var/log/gitlab 目錄下:
gitlab-ctl tail #查看所有日志
gitlab-ctl tail nginx/gitlab_access.log #查看nginx訪問(wèn)日志
本文標(biāo)題:GitLab的安裝和簡(jiǎn)單使用
轉(zhuǎn)載源于:http://m.5511xx.com/article/djjossg.html


咨詢
建站咨詢
