Centos8 搭建本地gitlab伺服器筆記

2022-08-29 20:18:17 字數 2093 閱讀 4662

一、安裝gitlab所需依賴(如果沒有)

$ sudo yum install curl openssh-server openssh-clients postfix cronie
安裝之前可以先檢查一下系統是否已經安裝了上面的工具,如果已安裝過就不用再安裝了。

二、安裝gitlab

$ curl -s  | 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:\windows\system32\drivers\etc\hosts)

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)

Centos 8搭建Redis集群

總體來說,本地的redis搭建集群比較簡單,基本可以概括為 1.建立redis bin目錄副本 2.修改redis config配置 3.啟動所有節點 在 usr local 下建立redis cluster資料夾 mkdir usr local redis cluster將redis中的bin目錄...

Centos8搭建LANM環境

lnmp 環境是指在 linux 系統下,由 nginx mysql mariadb php 組成的 伺服器架構 參考nginx官網的安裝指導 1.向yum repository 新增nginx vim etc yum.repos.d nginx.repo 插入以下內容 nginx stable n...

VNC server 服務搭建(centos 8)

普通使用者的身份在遠端centos計算機上登入搭建。通常,伺服器未安裝桌面環境。如果您要連線的計算機沒有gui,則第一步是安裝它。否則,請跳過此步驟。執行以下命令在遠端計算機上安裝gnome centos 8中的預設桌面環境 sudo dnf groupinstall server with gui...