0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

CentOS 7でGitLabサーバーを構築する手順(httpとhttpsに対応)

Last updated at Posted at 2021-07-01

構築手順

ステップ1:GitLabのインストール

# 必要なパッケージをインストールする
sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd

# ファイヤーウォールにhttpとhttpsを許可する
sudo systemctl start firewalld.service
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld

# postfixをインストールする
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

# GitLabをインストールする
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash

# GitLabサーバーのドメインを指定する
sudo EXTERNAL_URL="http://www.yourgitlabdomain.com" yum install -y gitlab-ee

ステップ2:https対応

GitLabはLet's Encryptに対応しているので、Let's EncryptでSSL化します。

# コンフィグをエディタで開く
sudo vi /etc/gitlab/gitlab.rb

コンフィグ内の次の設定を変更する。

external_url 'https://www.yourgitlabdomain.com'

letsencrypt['enable'] = true 

letsencrypt['contact_emails'] = ['email.address@email.com']

nginx['redirect_http_to_https'] = true
# コンフィグをリロードする。
sudo gitlab-ctl reconfigure
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?