天天看點

【GitLab】CentOS安裝GitLab最佳實踐環境安裝修改配置檔案 /etc/gitlab/gitlab.rb使用後記參考資料

伺服器安裝了

PHP7

Nginx,占用80端口

Mysql

安裝采用官網提供的安裝方法.

選擇 CentOS 7

GitLab對硬體的要求不是很高,很顯然,越好的硬體,越能支撐起更多的項目的和使用者.

Ubuntu

Debian

CentOS

Red Hat Enterprise Linux (please use the CentOS packages and instructions)

Scientific Linux (please use the CentOS packages and instructions)

Oracle Linux (please use the CentOS packages and instructions)

OS X

Arch Linux

Fedora

Gentoo

FreeBSD

比如Windows,并不支援.

如果你安裝postfix發送郵件,請選擇“網站設定”中。而不是使用字尾也可以使用sendmail配置自定義SMTP伺服器配置為SMTP伺服器。

修改配置檔案 <code>vi /etc/postfix/main.cf</code>

修改的部分為

啟動服務 <code>sudo systemctl start postfix</code>,成功.

<code>yum install firewalld</code>

<code>systemctl unmask firewalld</code>

<code>curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash</code>

執行上面的指令,會一直 time out ,是以我們要換成國内的源.

<code>vim /etc/yum.repos.d/gitlab-ce.repo</code>

注意,如果對應配置檔案下有檔案<code>gitlab_gitlab-ce.repo</code>,重命名一下,不然會預設加載這個導緻上面的檔案不起作用.

檢視目前的yum程序,并殺死

上面執行完了,是這樣的展示結果

<code>sudo gitlab-ctl reconfigure</code>

接下來會自動配置檔案權限,安裝資料庫….

提示!安裝的時間會很長!!!

根據我們伺服器監控記錄,配置過程花了5個小時!

目前的狀态是完成了安裝包的安裝,但是還沒有啟用配置檔案,是以依賴還都沒有裝。

是以非常不建議直接運作<code>sudo gitlab-ctl reconfigure</code>,不能再踩一次坑!QAQ

基本我們要調的東西都在<code>/etc/gitlab/gitlab.rb</code>裡面,是以這個檔案一定要仔細看好。

因為我們本機已經用了LNMP做了環境,是以可以直接采用Mysql作為我們的資料庫,而不用<code>postgresql</code>,減少伺服器的負擔。

企業版才支援使用mysql

QAQ

建立vhost下的配置檔案,指向GitLab檔案夾

上面的指令是通過<code>gitlab-ctl</code>安裝的,那麼通過<code>gitlab-ctl</code>指令一樣也能做别事情~

<code>gitlab-ctl</code>

這樣就知道了我們的服務怎麼使用了~

這個指令檢視我們的gitlab在運作過程中有沒有問題.

<code>gitlab-ctl tail</code>

GitLab對伺服器的要求比較高,文檔上說4核8G,我的1核512M的小伺服器在安裝多次後卡死多次。我決定暫時先放放。。。以後再做這個。。。

<a href="https://about.gitlab.com/gitlab-com/">https://about.gitlab.com/gitlab-com/</a>

<a href="http://www.chhua.com/web-note4929">http://www.chhua.com/web-note4929</a>

<a href="https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/">https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/</a>

<a href="https://about.gitlab.com/downloads/">https://about.gitlab.com/downloads/</a>

<a href="https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/database.md#database-settings">https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/database.md#database-settings</a>

繼續閱讀