CentOS 7安裝部署GitLab服務器

下面方法不行,則用該鏈接方法部署:https://ken.io/note/centos7-gitlab-install-tutorialnode

1. 安裝依賴軟件linux

yum -y install policycoreutils openssh-server openssh-clients postfixnginx

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

systemctl enable postfix && systemctl start postfixredis

3.下載gitlab安裝包,而後安裝sql

centos 6系統的下載地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6vim

centos 7系統的下載地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7centos

個人是centos7,因此我在https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7中找了個gitlab8.0.0版本,建議下載一個比較新的版本,我這裏選了一個比較舊的版本僅僅是實驗服務器

下載rpm包並安裝:ssh

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

rpm -i gitlab-ce-11.2.0-ce.0.el7.x86_64.rpm

4.修改gitlab配置文件指定服務器ip和自定義端口:

vim  /etc/gitlab/gitlab.rb

退出並保存

ps:注意這裏設置的端口不能被佔用,默認是8080端口,若是8080已經使用,請自定義其它端口,並在防火牆設置開放相對應得端口(若是端口被佔領

netstat -tunlp | grep "8080"
# netstat -tunlp | grep 8000
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN      26993/nodejs

5.重置並啓動GitLab

執行:

gitlab-ctl reconfigure

gitlab-ctl restart

ok: run: gitlab-git-http-server: (pid 3922) 1s
ok: run: logrotate: (pid 3929) 0s
ok: run: nginx: (pid 3936) 1s
ok: run: postgresql: (pid 3941) 0s
ok: run: redis: (pid 3950) 0s
ok: run: sidekiq: (pid 3955) 0s
ok: run: unicorn: (pid 3961) 1s

提示「ok: run:」表示啓動成功

6.訪問 GitLab頁面

若是沒有域名,直接輸入服務器ip和指定端口進行訪問(localhost:8080)

參考網址:https://www.linuxidc.com/Linux/2017-06/144990.htm

相關文章
相關標籤/搜索