文章目錄
- 一、安裝步驟
- 1、安裝相關依賴
- 2、啟動ssh服務&設定為開機啟動
- 3、設定postfix開機自啟,并啟動,postfix支持gitlab發信功能(可不開啟)
- 4、下載gitlab包
- 5、安裝Gitlab
- 7、修改Gitlab配置
- 8、多載配置及啟動Gitlab
- 9、登錄到頁面
- 10、登錄成功
- 二、網關操作
- 1、開啟相應防火墻
- 2、把埠添加到防火墻
- 三、問題解決
- 1、policycoreutils-python is needed by gitlab-ce-12.10.1-ce.0.el8.x86_64
- 2、重啟后輸入網址,無法連接
一、安裝步驟
1、安裝相關依賴
yum -y install policycoreutils openssh-server openssh-clients postfix
可能出現問題:

表示已經安裝,且為最新版本,不需要進行任何操作,
2、啟動ssh服務&設定為開機啟動
systemctl enable sshd && sudo systemctl start sshd
查詢服務啟動狀態
systemctl status sshd
查看狀態后,顯示running表示已經啟動,

3、設定postfix開機自啟,并啟動,postfix支持gitlab發信功能(可不開啟)
systemctl enable postfix && systemctl start postfix
postfix表示通信功能,如果不需要可以不開啟,

4、下載gitlab包
在線下載安裝包:
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-12.4.2-ce.0.el6.x86_64.rpm
5、安裝Gitlab
安裝:
rpm -ivh gitlab-ce-12.4.2-ce.0.el6.x86_64.rpm
出現的問題

解決方法
yum install policycoreutils-python
首次啟動時間可能有點長,多等待一會就好,
安裝成功:

7、修改Gitlab配置
vim /etc/gitlab/gitlab.rb
- 修改gitlab訪問地址和埠,默認為80,我們改為82,
- 修改Nginx監聽的埠號,
external_url 'http://9.205.35.164:82'
nginx['listen_port'] = 82
8、多載配置及啟動Gitlab
重新加載配置(時間長)
gitlab-ctl reconfigure
重啟gitlab(時間長)
gitlab-ctl restart
9、登錄到頁面
輸入網址
http://9.205.35.164:82
-
輸入新的密碼

-
使用新的賬號+新輸入密碼進行登錄(默認root用戶)

10、登錄成功
顯示當前頁面,表示登錄成功:

二、網關操作
1、開啟相應防火墻
查看是否開啟firewalld防火墻
systemctl status firewalld

開放ssh以及http服務,然后重新加載防火墻串列
firewall-cmd --add-service=ssh --permanent
firewall-cmd --add-service=http --permanent
firewall-cmd --reload
2、把埠添加到防火墻
firewall-cmd --zone=public --add-port=82/tcp --permanent
firewall-cmd --reload
三、問題解決
1、policycoreutils-python is needed by gitlab-ce-12.10.1-ce.0.el8.x86_64
是指缺少gitlab-ce-12.10.1-ce.0.el8.x86_64檔案,下載安裝即可,只針對centos7的,

解決方法
yum install policycoreutils-python
2、重啟后輸入網址,無法連接
步驟8、多載配置及啟動Gitlab,重啟成功以后,輸入網址還是無法連接,可能是沒有開啟相應的網路權限,需要自己在防火墻中添加相應的開放埠,
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/260722.html
標籤:其他
