• GitLab 安装与入门


    GitLab介绍:

      GitLab是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目。 

      GitLab拥有与Github类似的功能,能够浏览源代码,管理缺陷和注释。

     

    1安装依赖包

     yum install curl policycoreutils openssh-server openssh-clients postfix -y

     systemctl start postfix

     curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

     yum install -y gitlab-ce git

     

    2、生成SSL证书

     mkdir -p /etc/gitlab/ssl

     openssl genrsa -out "/etc/gitlab/ssl/gitlab.pso.com.key" 2048

     openssl req -new -key "/etc/gitlab/ssl/gitlab.pso.com.key" -out "/etc/gitlab/ssl/gitlab.pso.com.csr"

     openssl x509 -req -days 3650 -in "/etc/gitlab/ssl/gitlab.pso.com.csr" -signkey "/etc/gitlab/ssl/gitlab.pso.com.key" -out "/etc/gitlab/ssl/gitlab.pso.com.crt"

     openssl dhparam -out /etc/gitlab/ssl/dhparams.pem 2048

    3、需改Gitlab配置文件中的SSL

      vim /etc/gitlab/gitlab.rb

        external_url 'https://gitlab.pso.com'

        nginx['redirect_http_to_https'] = true

        nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.pso.com.crt"

        nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.pso.com.key"

        # nginx['ssl_dhparam'] = /etc/gitlab/ssl/dhparams.pem

    4、配置并启动Gitlab

      Gitlab-ctl reconfigure

      Gitlab-ctl status

      Gitlab-ctl stop

      Gitlab-ctl start

    5gitlab默认使用80或443端口,可以通过 lsof -i:80 查看

      [root@localhost ~]# lsof -i:80

      COMMAND   PID       USER   FD   TYPE DEVICE SIZE/OFF NODE NAME

      nginx   37010       root    7u  IPv4  58530      0t0  TCP *:http (LISTEN)

      nginx   37011 gitlab-www    7u  IPv4  58530      0t0  TCP *:http (LISTEN)

      nginx   37012 gitlab-www    7u  IPv4  58530      0t0  TCP *:http (LISTEN)

      nginx   37013 gitlab-www    7u  IPv4  58530      0t0  TCP *:http (LISTEN)

      nginx   37014 gitlab-www    7u  IPv4  58530      0t0  TCP *:http (LISTEN)

    6、第一次登录,修改密码(默认管理员为:root)

  • 相关阅读:
    指定盘符获取u盘PID、VID、序列号等信息
    禁用u盘再启用
    golang 使用编译选项-H=windowsgui后,仍然输出log到console
    c#实现"扫描检测硬件改动"
    哈希表
    Python 环境搭建
    Python 简介
    Python 基础教程
    7.1.2 定义改进的Sales_date类
    第七章 类
  • 原文地址:https://www.cnblogs.com/vincenshen/p/10466803.html
Copyright © 2020-2023  润新知