CentOS7 搭建gitlab服务器
本文介紹如何在CentOS7.2上搭建Gitlab服務(wù)器,并簡(jiǎn)單介紹如何使用。
Preface
使用的是CentOS7.2的操作系統(tǒng),安裝當(dāng)前最新版Gitlab服務(wù)器,下載地址:清華大學(xué)開(kāi)源軟件鏡像站。
gitlab-ce-12.0.-ce..el7.x86_64.rpm 610.5 MiB -- :
下載軟件包。
# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
# git --version
git version 1.8.3.1
# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.0.2-ce.0.el7.x86_64.rpm
# ls
gitlab-ce-12.0.2-ce.0.el7.x86_64.rpm
安裝依賴
gitlab依賴policycoreutils-python,需要先安裝相關(guān)依賴。
# yum install -y policycoreutils-python
安裝Gitlab服務(wù)器
使用rpm -i 可直接安裝相關(guān)軟件包。
# rpm -i gitlab-ce-12.0.-ce..el7.x86_64.rpm
warning: gitlab-ce-12.0.-ce..el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
It looks like GitLab has not been configured yet; skipping the upgrade script. *. *.
*** ***
***** *****
.****** *******
******** ********
,,,,,,,,,***********,,,,,,,,,
,,,,,,,,,,,*********,,,,,,,,,,,
.,,,,,,,,,,,*******,,,,,,,,,,,,
,,,,,,,,,*****,,,,,,,,,.
,,,,,,,****,,,,,,
.,,,***,,,,
,*,. _______ __ __ __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ `/ __ \
/ /_/ / / /_/ /___/ /_/ / /_/ /
\____/_/\__/_____/\__,_/_.___/ Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
sudo gitlab-ctl reconfigure For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
gitlab默認(rèn)占用8080端口,因?yàn)槲覀冞@是臨時(shí)測(cè)試使用,為了不被錯(cuò)殺,建議修改為其它非Web-like端口,如10101等其它端口。
修改端口
修改gitlab配置文件。
# vim /etc/gitlab/gitlab.rb
...
external_url 'http://xx.xx.xx.xx:10101' # ip:port的形式
重新配置
修改配置文件之后,需重新配置,執(zhí)行如下命令。
# gitlab-ctl reconfigure
...
Running handlers:
Running handlers complete
Chef Client finished, / resources updated in seconds
gitlab Reconfigured!
啟動(dòng)服務(wù)
配置完成之后,啟動(dòng)服務(wù)。
# gitlab-ctl restart
ok: run: alertmanager: (pid 3687) 0s
ok: run: gitaly: (pid 3697) 0s
ok: run: gitlab-monitor: (pid 3714) 0s
ok: run: gitlab-workhorse: (pid 3716) 1s
ok: run: grafana: (pid 3723) 0s
ok: run: logrotate: (pid 3742) 1s
ok: run: nginx: (pid 3750) 0s
ok: run: node-exporter: (pid 3756) 1s
ok: run: postgres-exporter: (pid 3765) 0s
ok: run: postgresql: (pid 3774) 1s
ok: run: prometheus: (pid 3777) 0s
ok: run: redis: (pid 3792) 0s
ok: run: redis-exporter: (pid 3816) 0s
ok: run: sidekiq: (pid 3904) 0s
ok: run: unicorn: (pid 3915) 0s
訪問(wèn)界面
訪問(wèn)剛才在配置文件中設(shè)置的http://xx.xx.xx.xx:10101
設(shè)置管理員密碼
如下界面,設(shè)置管理員密碼。
可以選擇登錄或注冊(cè),使用root和剛才設(shè)置的管理員口令進(jìn)行登錄。
目前空空如也。
可以創(chuàng)建項(xiàng)目、組、添加用戶和進(jìn)行相關(guān)配置,這樣Gitlab服務(wù)器便安裝完成。
總結(jié)
以上是生活随笔為你收集整理的CentOS7 搭建gitlab服务器的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 2023五菱宏光侠什么时候上市?
- 下一篇: orcale 之sql/plus set