Centos部署GitLab
安裝和配置必要的依賴項
yum -y install policycoreutils openssh-server openssh-clients postfix
設置postfix開機自啓,並啓動,postfix支持gitlab發信功能
systemctl enable postfix && systemctl start postfix
下載GitLab軟件包並安裝
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.4.0-ce.0.el7.x86_64.rpm
yum install -y policycoreutils-python
rpm -ivh gitlab-ce-11.4.0-ce.0.el7.x86_64.rpm
修改gitlab配置文件指定服務器ip和自定義端口
sed -i 's/80/8088/g' /var/opt/gitlab/nginx/conf/gitlab-http.conf
echo "nginx['listen_port'] = 8088" >> /etc/gitlab/gitlab.rb
重置並啓動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:」表示啓動成功
訪問GitLab頁面
若是沒有域名,直接輸入服務器ip和指定端口進行訪問
初始帳戶: root 密碼: 5iveL!fe
第一次登陸修改密碼,見下圖
![Centos部署GitLab](http://static.javashuo.com/static/loading.gif)