安装和配置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
执行结果
如果是开启状态执行以下操作
永久生效,开启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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 张高兴的大模型开发实战:(一)使用 Selenium 进行网页爬虫
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构