1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[Ubuntu][Apache]サイトにsslを設定する方法

Posted at

要 旨

OSはUbuntu22.04LTS、WebサーバーはApacheの組み合わせでサイトにsslを設定する方法について記述します。

実行環境等

ドメイン取得:ムームードメイン
KAGOYAのVPS契約
VPS:KAGOYA VPS KVM 大容量 CPU:2コア メモリ:2GB ストレージ:200GB
OS:Ubuntu22.04LTS
料金:32円/日、880円/月(2024.3.24時点)
使用PC:DELL G16 7630(ノートPC cpu:i7 13650HX メモリ:16GB ストレージ;500GB)

実施要領

最初にドメインを取得する。(ムームードメイン)
KAGOYAにVPS契約実施
ムームードメインでDNSの設定を実施する
KAGOYA VPSでドメインのDNS設定を実施する
(ドメインの登録と、契約したサーバーの正引きにドメイン登録の2つを実施)

サーバーにログイン。
以下rootで実施した。
アップデート

apt update

アップグレード

apt upgrde

apache2のインストール

apt -y install apache2

snapのアップデート

snap install core
snap refresh core

既にインストるされているcertbot-autoの解除

apt install dnf
dnf remove certbot

certbotのインストール

snap install --classic certbot

certbotコマンドの準備

ln -s /snap/bin/certbot /usr/bin/certbot

certbotをapache2に自動設定する。

certbot --apache

これで指示に従って入力していく。

  • メールアドレスの入力
  • 利用規約に同意する Y(es)
  • メールアドレスにお知らせを受信するか聞かれる Y(es) またはN(o)
  • ドメインを入力する
    Successfullyが表示されれば成功

ブラウザでhttps://[ドメイン名]にアクセスして、/var/www/html/index.htmlが表示されれば完成(最初はApacheの初期画面が表示される)
なおUbuntu22.04LTSではsslの3か月更新が自動更新されれるので、更新については特に処置しなくてよい。

以上でsslの設定終了です。お疲れさまでした。

結 言

今回は、OSはUbuntu22.04LTS、WebサーバーはApacheの組み合わせでサイトにsslを設定する方法について記述しました。
最後までご覧くださり、ありがとうございました。

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?