centos 8.3安装 一键安装部署gitlab

 

安装和配置gitlab必须的依赖包

[root@gitlabdev ~]#dnf install -y curl policycoreutils openssh-server perl

设置开机自启sshd

[root@gitlabdev ~]#systemctl enable sshd

启动sshd

[root@gitlabdev ~]#systemctl start sshd

查看防火墙的状态

[root@gitlabdev ~]#systemctl status firewalld

执行结果

image

如果是开启状态执行以下操作

永久生效,开启http服务

[root@gitlabdev ~]#firewall-cmd --permanent --add-service=http

永久生效,开启https服务

[root@gitlabdev ~]#firewall-cmd --permanent --add-service=https

重新加载一下设置

[root@gitlabdev ~]#systemctl reload firewalld

安装用于发送邮件通知的Postfix

安装Postfix

[root@gitlabdev ~]#dnf install postfix

设置postfix开机自启

[root@gitlabdev ~]#systemctl enable postfix

启动postfix

[root@gitlabdev ~]#systemctl start postfix

下载安装Gitlab安装包

[root@gitlabdev ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el8/gitlab-ce-14.0.4-ce.0.el8.x86_64.rpm

可以根据自己的系统选择不同的安装版本

清华园下载链接:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum

安装gitlab

[root@gitlabdev ~]#rpm -Uvh gitlab-ce-14.0.4-ce.0.el8.x86_64.rpm

更改gitlab默认端口

[root@gitlabdev ~]# vim  /etc/gitlab/gitlab.rb

修改内容:external_url
后改为自己的http://ip:端口;
unicorn['port'] = 28080 修改 unicorn['port'] 端口;
!注意,两个端口不能一样

使用gitlab-ctl reconfigure

自动配置,并安装数据库,初始化信息,如下所示(第一次使用配置时间较长)

[root@gitlabdev ~]#gitlab-ctl reconfigure
=====================================================================================
至此系统已经启动,可在网页输入系统的IP+端口即可进入登录,初次登录要求修改root管理员密码;
在浏览器中输入 http://ip:端口/ ,然后 change password: ,并使用root用户登录 即可 (后续动作根据提示操作)
如操作太快,没有记住密码,可参看另一篇博客进行修改密码
修改密码链接:https://www.cnblogs.com/cndevops/p/14973118.html
=====================================================================================

使用gitlab-ctl

启动所有gitlab组件

[root@gitlabdev ~]#gitlab-ctl start

启动服务

[root@gitlabdev ~]#gitlab-ctl reconfigure

停止服务

[root@gitlabdev ~]#gitlab-ctl stop
posted @ 2021-07-09 15:18  老头还我葵花宝典  阅读(195)  评论(0编辑  收藏  举报