GitLab官網(wǎng):
https://about.gitlab.com/
官網(wǎng)
找到Resources(資源) | 選擇Install(安裝)
安裝
找到服務器相對應的版本
版本
我以centos7為例
image.png
點擊之后,安裝的代碼會在下面顯示出來
image.png
代碼2
1.安裝并配置必要的依賴項
yum install -y curl \
policycoreutils-python \
openssh-server //安裝依賴包
systemctl enable sshd //開機自啟ssh服務
systemctl start sshd //開啟sshd服務
firewall-cmd \
--permanent \
--add-service=http //添加防火墻出口
systemctl reload firewalld //防火墻配置生效
2.安裝Postfix以發(fā)送通知電子郵件
yum install postfix //安裝postfix
systemctl enable postfix //開機自啟postfix
systemctl start postfix //開啟postfix
3.添加GitLab軟件包存儲庫并安裝軟件包
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
//添加GitLab包存儲庫。
yum install -y gitlab-ee //安裝Gitlab
4.修改配置文件,設置服務器IP和端口。
vim /etc/gitlab/gitlab.rb //編輯配置文件
external_url 'https://gitlab.example.com' //配置服務器ip和端口
5.重置并啟動GitLab
gitlab-ctl reconfigure //重置GitLab
gitlab-ctl restart //重啟GitLab
6.登陸GitLab
網(wǎng)頁訪問https://IP:端口號
502報錯排查
1.權限
chmod -R 755 /var/log/gitlab //增加權限
2.端口被占用
vim /etc/gitlab/gitlab.rb //編輯配置文件
external_url '*****:*****' //更改端口
3.內存不足
安裝GitLab需要至少4G的內存