[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

Let's EncryptでSSL証明書を取得、管理しよう

こんにちは! システムソリューション部のしめじです。
皆さんは SSL 証明書ってご存知ですか?
これは「通信データの暗号化」を行うための電子証明書で、最近はサイトに設置がデフォルトだったりします。

ただ、この証明書には期限があって、期限が切れたら証明書の更新作業を実施しなければいけません。
そんな更新作業を実施するのが面倒だと感じる方には、更新作業を自動化できる「Let's Encrypt」をオススメします。

Let's Encryptとは?

アメリカの非営利団体 ISRG が提供しているサービスになります。
なんとこのサービスは証明書の発行が完全に無料です!(データ通信費は除く。)
これは使わないと損ですね。

ちょっとだけ面倒ではありますが、このサービスを利用する価値は大いにあります。

それでは下記手順になります。

certbot クライアントのインストール

epel をインストール
yum install epel-release
certbot をインストール
yum install --enablerepo=epel certbot python-certbot-apache

証明書の取得

取得には下記のコマンドを実行してください。

certbot certonly --webroot \
-w 【ドキュメントルート】 \
-d 【ドメイン名】 \
-m 【メールアドレス】 \
--agree-tos -n

・【ドキュメントルート】【ドメイン名】【メールアドレス】は適宜環境に併せて変更してください。
・ドキュメントルート以下にファイルが自動的に作成されて、そのファイルで認証を実施するので80番ポートは開けておいて下さい。

証明書の確認

コマンド1つで下記ディレクトリに証明書が一瞬で作成されます。
=============================================
#サーバ証明書
/etc/letsencrypt/live/【ドメイン名】/cert.pem
#秘密鍵
/etc/letsencrypt/live/【ドメイン名】/privkey.pem
#中間証明書
/etc/letsencrypt/live/【ドメイン名】/chain.pem
=============================================
ただ、証明書の更新期限が3ヶ月しかないので注意です。

証明書の更新

下記のコマンドで証明書の更新が完了します。

certbot renew --post-hook "systemctl reload httpd"

これを cron に登録しておけば、あとは何もしなくても勝手に証明書が更新されますね。

crontab -e


00 06 01 * * root /bin/certbot renew --post-hook "systemctl reload httpd"

まとめ

今回は無料の SSL 証明書取得方法について書かせて頂きましたが、ビヨンドではその他 SSL 証明書の申請代行や設置も行っております。
SSL 設置設定ならビヨンドに丸投げ
サイトを SSL 化する必要がございましたらお問い合わせくださいませ。

この記事がお役に立てば【 いいね 】のご協力をお願いいたします!
1
読み込み中...
1 票, 平均: 1.00 / 11
1,125
X facebook はてなブックマーク pocket
[2024.6.30 CentOS support ended] CentOS server migration solution

[2024.6.30 CentOS support ended] CentOS server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

The person who wrote this article

About the author

Shimeji mushrooms

CERTIFICATE:
- TOEIC 835
- LPIC304
- AWS Solution Architect Associate
- AWS Solution Architect Professional
- GCP Professional Cloud Architect
- IPA SC (not registered)

Kagome, Kagome,
the old man behind me, that's it.

It's my uncle. (2018)