阿里雲安裝GitLab

目錄

 

1、安裝相關依賴

2、啓動ssh服務&設置爲開機啓動

3. 設置postfix開機自啓,並啓動,postfix支持gitlab發信功能

4. 開放ssh以及http服務,然後重新加載防火牆列表

5. 下載gitlab包,並且安裝在線下載安裝包:

6. 修改gitlab配置

7. 重載配置及啓動gitlab

8. 把端口添加到防火牆


1、安裝相關依賴

yum -y install policycoreutils openssh-server openssh-clients postfix
yum install policycoreutils-python -y

2、啓動ssh服務&設置爲開機啓動

systemctl enable sshd && sudo systemctl start sshd

3. 設置postfix開機自啓,並啓動,postfix支持gitlab發信功能

systemctl enable postfix && systemctl start postfix

4. 開放ssh以及http服務,然後重新加載防火牆列表

firewall-cmd --add-service=ssh --permanent
firewall-cmd --add-service=http --permanent
firewall-cmd --reload

5. 下載gitlab包,並且安裝
在線下載安裝包:

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-12.4.2-ce.0.el6.x86_64.rpm

安裝:

rpm -i gitlab-ce-12.4.2-ce.0.el6.x86_64.rpm

6. 修改gitlab配置

vi /etc/gitlab/gitlab.rb

修改gitlab訪問地址和端口,默認爲80,我們改爲82
external_url 'http://公網ip:82'
nginx['listen_port'] = 82


7. 重載配置及啓動gitlab

gitlab-ctl reconfigure
gitlab-ctl restart

這一步執行的時候我的出現報錯(沒有則省略)

There was an error running gitlab-ctl reconfigure: ruby_block[authorize Grafana with GitLab] (gitlab::grafana line 92) had an error: Mixlib::ShellOut::CommandTimeout: Command timed out after 600s

經查是內存大小導致的原因

可以試下如下解決方法

gitlab-ctl stop
chmod 755 /var/opt/gitlab/postgresql
systemctl restart gitlab-runsvdir
gitlab-ctl reconfigure
gitlab-ctl restart

8. 把端口添加到防火牆

firewall-cmd --zone=public --add-port=82/tcp --permanent
firewall-cmd --reload

接着輸入在瀏覽器輸入http://公網ip:82,即可看到如下

再等一會兒就可以進入密碼設置頁面了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章