• Linux CentOS8安装gitlab_ce步骤


    1 下载安装包

    wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/8/gitlab-ce-15.0.2-ce.0.el8.x86_64.rpm/download.rpm
    
    
    • 1
    • 2

    在这里插入图片描述

    2 安装gitlab

    yum install  policycoreutils-python-utils
    
    rpm -Uvh gitlab-ce-15.0.2-ce.0.el8.x86_64.rpm
    
    
    • 1
    • 2
    • 3
    • 4

    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

    3 更新配置(初始化已经安装好的GitLab(这个也要花点时间的)

    gitlab-ctl reconfigure 
    
    • 1

    在这里插入图片描述

    3.1 启动gitlab

    gitlab-ctl start
    
    • 1

    3.2 查看gitlab运行状态

    gitlab-ctl status
    
    -- 间图说明安装成功了
    
    • 1
    • 2
    • 3

    4 防火墙允许http访问

    firewall-cmd --permanent --add-service=http //允许http访问
    firewall-cmd --zone=public --add-port=8600/tcp --permanent //开放自己的端口
    systemctl restart firewalld
    
    
    • 1
    • 2
    • 3
    • 4

    5 修改端口号

    vim /etc/gitlab/gitlab.rb
    
    --并将external_url 里面的内容更换为自己在的ip和端口  
    --注意:
    	切记(这个ip一定是你服务器的ip  不要在服务器使用命令ifconfig-a 去查看ip  那个ip是不对的。)
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述

    6 看看root密码

    cat /etc/gitlab/initial_root_password
    
    -- 查看密码之后,将密码赋值出来,便于修改
    
    • 1
    • 2
    • 3

    在这里插入图片描述

    7 重新加载配置文件

    gitlab-ctl reconfigure
    
    -- 部分显示如下:
    -- 报错如下
    
    • 1
    • 2
    • 3
    • 4

    在这里插入图片描述

    解决办法

    export LC_ALL=en_US.UTF-8
    export LANG=en_US.UTF-8
    export LANGUAGE=en_US.UTF-8
    source ~/.bashrc
    
    重新执行如下: gitlab-ctl reconfigure
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    9 重启gitlab

    sudo gitlab-ctl restart
    
    • 1

    相关命令

    firewall-cmd --list-ports  查看开放了哪写端口命令
    firewall-cmd --zone=public --add-port=7070/tcp --permanent
    firewall-cmd --reload   #开放某个端口 并重新加载
    
    sudo gitlab-ctl start    # 启动所有 gitlab 组件;
    sudo gitlab-ctl stop        # 停止所有 gitlab 组件;
    sudo gitlab-ctl restart        # 重启所有 gitlab 组件;
    sudo gitlab-ctl status        # 查看服务状态;
    sudo gitlab-ctl reconfigure        # 重新配置更新
    sudo vim /etc/gitlab/gitlab.rb        # 修改默认的配置文件;
    gitlab-rake gitlab:check SANITIZE=true --trace    # 检查gitlab;
    sudo gitlab-ctl tail        # 查看日志;
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13

    如何配置自己的redis

    gitlab_rails['redis_host'] = '127.0.0.1'
    
    gitlab_rails['redis_port'] = 6379
    
    gitlab_rails['redis_password'] = 'redis123' #访问redis的密码
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    如何修改默认的gitlab密码

    输入命令:
    	sudo gitlab-rails console
    
    配置:
    	1. 用户名方式:user = User.find_by_username 'root'      
    	   id方式:or user = User.find(1)    
    	   邮箱方式:or    user = User.find_by(email: 'user@example.com')
    
    	 2. 设置密码:
    	    user.password = 'root123456'
    	    user.password_confirmation = 'root123456'
    	    user.save!
    	    密码设置成功!
    	    gitlab-ctl reconfigure
    	    gitlab-ctl start
    
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17

    卸载

    1、软件的卸载主要是使用rpm来进行的。卸载软件首先要知道软件包在系统中注册的名称。键入命令:
    	rpm -q -a
    2. 查找gitlab 是否安装 如果安装使用
    	rpm -qa | grep gitlab
    
    4.确定了要卸载的软件的名称,就可以开始实际卸载该软件了。键入命令
    	rpm -e [package name]
    
    5. 查看防火墙状态
    	firewall-cmd --state
    
    6.关闭防火墙:
    	systemctl stop firewalld
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
  • 相关阅读:
    2024年最新阿里云和腾讯云云服务器价格租用对比
    LCR 144. 翻转二叉树
    跨域访问错误的这一种解决方法
    docker搭建私有仓库
    【C++项目】高并发内存池第二讲中心缓存CentralCache框架+核心实现
    Linux内存寻址
    【GO】基础速成
    数据库安全如何保障?YashanDB有妙招(上篇)
    金仓数据库KingbaseES数据库参考手册(服务器配置参数9. 错误报告和日志)
    【Python】【Flask】提交表单后报500错误
  • 原文地址:https://blog.csdn.net/weixin_44145338/article/details/133790226