• Centos8 搭建本地gitlab服务器笔记


    文档地址:https://packages.gitlab.com/gitlab/gitlab-ce

    一、安装gitlab所需依赖(如果没有)

    $ sudo yum install curl openssh-server openssh-clients postfix cronie  
    

    安装之前可以先检查一下系统是否已经安装了上面的工具,如果已安装过就不用再安装了。

    二、安装gitlab

    $ curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
    $ dnf install -y gitlab-ce
    

    三、配置ssl证书

    $ mkdir -p /etc/gitlab/ssl
    
    $ cd /etc/gitlab/ssl
    
    $ openssl genrsa -out "/etc/gitlab/ssl/gitlab.example.com.key" 2048
    
    $ openssl req -new -key "/etc/gitlab/ssl/gitlab.lwt.com.key" -out "/etc/gitlab/ssl/gitlab.lwt.com.csr"
    
    $ openssl x509 -req -days 365 -in "/etc/gitlab/ssl/gitlab.lwt.com.csr" -signkey "/etc/gitlab/ssl/gitlab.lwt.com.key" -out "/etc/gitlab/ssl/gitlab.lwt.com.crt"
    
    $ openssl dhparam -out /etc/gitlab/ssl/dhparams.pem 2048
    # 修改权限
    $ chmod 600 *
    
    # 修改gitlab.rb中的下面三项配置为前面步骤所创建的文件
    # nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.example.com.crt"
    # nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.lwt.com.key"
    # nginx['ssl_dhparam'] = "/etc/gitlab/ssl/dhparams.pem"
    $ vim /etc/gitlab/gitlab.rb
    
    

    四、 初始化gitlab相关配置

    # 初始化gitlab相关配置
    $ gitlab-ctl reconfigure
    

    五、修改/var/opt/gitlab/nginx/conf/gitlab-http.conf

    server_name gitlab.example.com;
    rewrite ^(.*)$ https://$host$1 permangent
    

    六、重启gitlab服务

    $ sudo gitlab-ctl restart
    

    七、将gitlab服务器ip地址和上面配置的域名(gitlab.example.com)的对于关系配置到客户端电脑上(可选,可以直接使用ip访问)

    window:(C:WindowsSystem32driversetchosts)

    gitlabip gitlab.example.com
    

    linux:(vim /etc/hosts)

    gitlabip gitlab.example.com
    

    ps:在Centos8上安装新版本的gitlab好像需要内存在2G以上,内存不足2G时初始化配置时会报错:

    * Errno::ENOMEM occurred in delayed notification: execute[reload all sysctl conf] (package::sysctl line 18) had an error: Errno::ENOMEM: Cannot allocate memory - fork(2)
    * Errno::ENOMEM occurred in delayed notification: runit_service[gitlab-workhorse] (gitlab::gitlab-workhorse line 49) had an error: Errno::ENOMEM: Cannot allocate memory - fork(2)
    
  • 相关阅读:
    比较器 Comparable 与compartor 的区别及理解
    事务特性、事务隔离级别、spring事务传播特性
    分布式文件上传-FastDFS
    spring-cloud 组件总结以及搭建图示 (六)
    springCloud zuul网关(五)
    hashCode与equals 通过面试题一窥究竟
    【原】那年30岁
    【原】Hyper-V虚拟机设置外部网络访问
    【原】win10 .net framework 3.5安装
    【原】做梦有感
  • 原文地址:https://www.cnblogs.com/yourblog/p/12839987.html
Copyright © 2020-2023  润新知