centos8安装gitlab-ce

 

知识了解:

GitLab有三个不同的版本可用:Community Edition(CE)、Enterprise Edition(EE)和 GitLab托管版本。其中CE版本是开源免费的。EE版本是企业版,需要付费使用的。

推荐:

cpu核心数量为4核,内存大小为4GB,磁盘大小为60G

1.安装gitlib前需要更新一下系统

yum update -y

 

2.安装和启用policycoreutils、openssh-server和openssh-clients组件,并将它们开放防火墙(不要忘了reload防火墙)

dnf install -y curl policycoreutils openssh-server openssh-clients
systemctl enable sshd
systemctl start sshd
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
systemctl reload firewalld

 与邮件通知相关的Postfix组件其实可以暂时不用安装和配置,这个可以放到后面再来配置一个外部的SMTP服务器

dnf install postfix
systemctl enable postfix
systemctl start postfix

3.使用vi或vim新建并编辑yum源配置文件 /etc/yum.repos.d/gitlab-ce.repo 

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
​

​

  使用yum包管理器安装Gitlab CE版

yum makecache
yum -y install gitlab-ce

 

修改gitlab.rb配置文件

vim /etc/gitlab/gitlab.rb

 

使用gitlab-ctl工具根据修改后的配置文件重新配置gitlab服务实例使配置生效

gitlab-ctl reconfigure

 

gitlab服务实例重新配置完成后,可以使用gitlab-ctl工具查看一下gitblab的服务状态

gitlab-ctl status

 

ps:

启动gitlab服务 :sudo gitlab-ctl start

gitlab服务停止 :sudo gitlab-ctl stop

重启gitlab服务 :sudo gitlab-ctl restart

 4.访问应用

打开浏览器

输入ip地址访问

完成!!!

ps:如果输入ip访问的时候nginx错误

解决方法:

 vim /etc/yum.repos.d/nginx.repo

添加以下内容

[nginx-stable]

name=nginx stable repo

baseurl=http://nginx.org/packages/centos/$releasever/$basearch/

gpgcheck=1

enabled=1

gpgkey=https://nginx.org/keys/nginx_signing.key

[nginx-mainline]

name=nginx mainline repo

baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/

gpgcheck=1

enabled=0

gpgkey=https://nginx.org/keys/nginx_signing.key

yum install nginx

即可

猜你喜欢

转载自blog.csdn.net/dp340823/article/details/112498708