为yum添加Gitlab下载源
vim /etc/yum.repos.d/gitlab-ce.repo
[gitlab-ce] name=Gitlab CE Repository baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/ gpgcheck=0 enabled=1 [root@localhost ~]# yum makecache
yum安装Gitlab
yum install gitlab-ce
配置Gitlab
vim /etc/gitlab/gitlab.rb
external_url 'https://gitlab.xxx.cn'
or extrenal_url 'https://192.168.xxx.xxx:xxxx'
配置防火墙
若上一步设置的为ip地址即端口,则要把端口加入防火墙,并重启防火墙
systemctl stop firewalld.service
firewall-cmd --zone=public --add-port=xxxx/tcp --permanent
systemctl start firewalld.service
刷新配置
systemctl restart gitlab-runsvdir
gitlab-ctl reconfigure
启动服务
gitlab-ctl restart
gitlab-ctl status