Centos部署GitLab

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

相关推荐