GitLab CE CentOS 8 环境安装

GitLab简介

介绍:

  • GitLab是利用Ruby on Rails一个开源的版本管理系统,实现一个自托管的Git项目仓库,可通过Web 界面进行访问公开的或者私人项目。

  • GitLab能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个文件历史库。团队成员可以利用内置的简单聊天程序(Wall)进行交流。

版本:GitLab 分为社区版(CE) 和企业版(EE)

GitLab CentOS 8 安装

温馨提示:如果你没有CentOS服务器,可以去阿里云申请免费的,本次部署环境是CentOS 8.5 64位

1. 服务器版本查询

通过SSH登录服务器,然后查询版本,输入命令:lsb_release -a

image

2. 下载RPM包

在CentOS安装GitLab,看到GitLab的安装包,有区分el6、el7、el8

EL是Red Hat E nterprise L inux(EL)的缩写。

el6 是Red Hat 6.x、CentOS 6.x 的下载
el7 是Red Hat 7.x、CentOS 7.x 的下载
el8 是Red Hat 8.x、CentOS 8.x 的下载

GitLab CE 国内清华园
GitLab CE 官方

安装前置依赖

# 安装并配置必要的依赖
yum install -y curl policycoreutils-python openssh-server
systemctl enable sshd
systemctl start sshd

# CentOS 系统中,在防火墙打开场景下,打开HTTP, HTTPS和SSH访问
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
systemctl reload firewalld

# 安装Postfix,用来发送通知邮件
yum install postfix
systemctl enable postfix
systemctl start postfix

下载命令:

wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/8/gitlab-ce-14.9.3-ce.0.el8.x86_64.rpm/download.rpm

image

image

下载完成查看下载的文件命令:ls

image

2. 安装RPM包

温馨提示:在安装过程中会提示需要依赖包,根据提示进行相对于安装
执行命令:rpm -ivh gitlab-ce-14.9.3-ce.0.el8.x86_64.rpm

image

3. 修改gitlab配置文件

gitlab的配置文件是:/etc/gitlab/gitlab.rb

image

输入命令进行修改:vim /etc/gitlab/gitlab.rb vim操作请参考

修改这行:external_url 'http://ip'

image

重载配置:gitlab-ctl reconfigure

需要耐心等待非常久

image

进行iptables配置,由于测试,前面external_url 'http://ip:8090'换成8090端口了,默认不配置端口是80

iptables -L -n
iptables -I INPUT -p tcp --dport 8090 -j ACCEPT
iptables-save

阿里云服务器配置安全组

image

浏览器输入地址:http://39.104.165.48:8090/

image

4. 获取登录账号密码

查看初始化密码是否存在:cd /etc/gitlab

查看密码:vim /etc/gitlab/initial_root_password

image

账号:root
密码:CesGxbHQazZIEhn4MB5LReYnd+CQuxKGIZdIM3DO+ss=

image

image

修改密码:
image

image

posted @ 2022-04-13 13:45  零点-Angelo  阅读(1435)  评论(0编辑  收藏  举报