首页 > 系统相关 >CentOS 7 安装gitLab 全过程

CentOS 7 安装gitLab 全过程

时间:2022-08-21 16:11:54浏览次数:73  
标签:... gitlab CentOS ssl gitLab etc 全过程 com example

1.关闭防火墙 && 禁用防火墙
systemctl stop firewalld
systemctl disable firewalld

2.关闭SELLINUX安全策略
vi /etc/sysconfig/selinux

...
SELINUX=disable
...

reboot

3.安装Omnibus GitLab-ce package

1.安装GitLab组件(邮件发送组件)
yum -y install curl policycoreutils openssh-server openssh-clients postfix

2.配置YUM仓库
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

3.启用postfix邮件服务
systemctl start postfix && systemctl enable postfix
如启动报错:(注意确认防火墙已经关闭)
vim /etc/postfix/main.cf
inet_protocols = ipv4
inet_interfaces = all

4.安装GitLab-ce 社区版本
yum install -y gitlab-ce

5.创建证书
mkdir -p /etc/gitlab/ssl
openssl genrsa -out "/etc/gitlab/ssl/gitlab.example.com.key" 2048
openssl req -new -key "/etc/gitlab/ssl/gitlab.example.com.key" -out "/etc/gitlab/ssl/gitlab.example.com.csr"

创建签署证书
openssl x509 -req -days 365 -in "/etc/gitlab/ssl/gitlab.example.com.csr" -signkey "/etc/gitlab/ssl/gitlab.example.com.key" -out "/etc/gitlab/ssl/gitlab.example.com.crt"

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

更改权限 chmod 600 *

6.配置证书到gitlab
vi /etc/gitlab/gitlab.rb
...
external_url 'https://gitlab.example.com'
nginx['redirect_http_to_https'] =true

...
nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.example.com.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.example.com.key"
...
nginx['ssl_dhparam'] = "/etc/gitlab/ssl/dhparams.pem"
...

7.重新配置gitLab (注意如果虚拟机内存配置过小可能出现一些莫名错误,建议配置2G)
gitlab-ctl reconfigure

8.配置NGINX
vi /var/opt/gitlab/nginx/conf/gitlab-http.conf
...
server{
...
server_name
...
rewrite ^(.*)$ https://$host$1 permanent;
}
...
gitlab-ctl restart

9.默认会有一个root用户,默认密码在/etc/gitlab/initial_root_password ,这里直接修改密码是不生效的。
如果这个密码无法登录可以尝试以下办法登录:
cd /opt/gitlab/bin
gitlab-rails console
u=User.where(id:1).first
u.password='12345678'
u.save!

标签:...,gitlab,CentOS,ssl,gitLab,etc,全过程,com,example
From: https://www.cnblogs.com/ms_senda/p/16610160.html

相关文章

  • Linux Centos 打开和关闭防火墙
      systemctlstatusfirewalld.service#查看防火墙状态systemctlstartfirewalld.service#开启防火墙systemctlstopfirewalld.service#关......
  • CentOS7安装Telnet服务
    CentOS7安装Telnet服务1.在安装Telnet前先检查系统是否安装了telnet-server和xinetdrpm-qatelnet-serverrpm-qaxinetd2.如果没有安装,则开始安装yum-yinstallteln......
  • CentOS7.5部署Jenkins
    一开始选择用Tomcat8.5部署jenkins,出现404报错  一直找不到原因。后来Tomcat换成9.0.65版本,Jenkins去清华网站下载最新版本。https://mirrors.tuna.tsinghua.edu.c......
  • CentOS7时间显示不对问题
     今天排查问题的时候查看日志,发现时间不对[root@centos7-55bin]#dateSatAug2005:03:38EDT2022[root@centos7-55bin]#ntpdatentp1.aliyun.com同步一次时间之......
  • Vmware 安装CentOS 7
    Vmware安装CentOS7创建虚拟机1、新建虚拟机,选择自定义(高级),下一步。其他默认下一步。选择操作系统Linux,CentOS764位,下一步。输入主机名称,虚拟机存储位置。2、输入内......
  • centos8下安装gcc11
    最近的云服务器使用的centos8,c以前编译器对c++20的新特性支持的较少,当前最新版的gcc对c++20的支持还是可以的,于是准备体验一下,首要就是升级gccgcc官网:https://gcc.gnu.......
  • centos常用命令及软件安装
    常用命令pwd查看当前所在目录free-h查看内存使用情况df-lh查看磁盘空间使用情况uname-a查看系统版本nohub[命令]&后台运行ps-ef|grep[关键字]查看相关进程的......
  • centos7安装nginx
    1、解压tar-zxvfnginx.tar.gz2、进入解压后的文件cdnginx3、执行configure文件./configure可能会有报错:./configure:error:theHTTPgzipmodulerequiresth......
  • 设置centos系统的命令提示符为绿色
     修改PS1变量即可实现临时修改exportPS1='\[\e[1;32m\][\u@\h\W]\$\[\e[0m\]' 永久修改echo"exportPS1='\[\e[1;32m\][\u@\h\W]\\$\[\e[0m\]'">>/etc/......
  • Jenkins+gitlab+docker+harbor容器化自动部署详细流程
    环境:Linux版本:Centos7一、更新源:yumupdate二、安装docker:yuminstalldocker-y启动docker:systemctlstartdocker三、.安装gitlab1.docker......