ubuntu下Gitlab部署

1.安裝依賴包

>sudo apt-get install curl openssh-server ca-certificates postfix
注:執(zhí)行完成后,出現(xiàn)郵件配置,選擇Internet那一項(不帶Smarthost的)

2.進(jìn)行主程序的安裝

首先信任 GitLab 的 GPG 公鑰

curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null

安裝 gitlab-ce

sudo apt-get update
sudo apt-get install gitlab-ce

3.啟動各項服務(wù)

sudo gitlab-ctl reconfigure

4.檢查GitLab是否安裝好并且已經(jīng)正確運行

sudo gitlab-ctl status

查看端口占用情況

netstat -tunlp

常見錯誤
訪問gitlab,出現(xiàn):502
GitLab在使用的過程中,會開啟80端口,如果80端口被其他的應(yīng)用程序占用,則GitLab的該項服務(wù)不能使用,所以訪問GitLab會失敗。大多數(shù)皆是此問題。
還要注意gitlab還要使用8080端口,因此要注意可以把gitlab端口改為別的無服務(wù)占用的端口。

改gitlab端口:

vim /etc/gitlab/gitlab.rb

unicorn['port'] = 9090 
nginx['listen_port'] = 9099

vim /var/opt/gitlab/gitlab-rails/etc/unicorn.rb

listen “127.0.0.1:9090”, :tcp_nopush => true

修改默認(rèn)的gitlab nginx的web服務(wù)80端

vim /var/opt/gitlab/nginx/conf/gitlab-http.conf

listen *:9099;

重啟配置:

sudo gitlab-ctl reconfigure

重新啟動gitlab

gitlab-ctl restart

更改密碼

gitlab-rails console
> user = User.where(id: 5).first
> user.password=12345678
> user.password_confirmation=12345678
> user.save

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容