3
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.

GCPなどのBitnami WordPressで無料SSL(Let's Encrypt)を設定する

Last updated at Posted at 2020-05-10

Bitnami公式ツールを使う

bitnamiのWordPressでSSL設定を行いたいと思い調べたら、letsencryptをカスタムインストールして証明書発行を行う解説記事が多かったのですが、Bitnamiが公式でbncert-toolというものを出しているので、こちらを使えば再起動まで自動でやってくれます。

手順

$ sudo /opt/bitnami/bncert-tool
----------------------------------------------------------------------------
Welcome to the Bitnami HTTPS Configuration tool.

----------------------------------------------------------------------------
Domains

Please provide a valid space-separated list of domains for which you wish to 
configure your web server.

Domain list []: sub.domain.com
1. ドメインリストの入力を求められるのでカンマ区切りで入力 `example.com, example2.com`

The following domains were not included: www.sub.domain.com. Do you want to add them? [Y/n]: n
2. wwwを加えるかどうかを聞かれるので答える `Y/n`

Please select the redirections you wish to enable or disable on your Bitnami 
installation.

Enable HTTP to HTTPS redirection [Y/n]: y
3. 強制リダイレクトを有効にするかを聞かれるので答える `Y/n`

The following changes will be performed to your Bitnami installation:

1. Stop web server
2. Configure web server to use a free Let's Encrypt certificate for the domains: 
sub.domain.com
3. Configure a cron job to automatically renew the certificate each month
4. Configure web server name to: sub.domain.com
5. Enable HTTP to HTTPS redirection (example: redirect http://sub.domain.com 
to https://sub.domain.com)
6. Start web server once all changes have been performed

Do you agree to these changes? [Y/n]: y
4. 変更内容を確認してEnter

Create a free HTTPS certificate with Let's Encrypt
...

5. メールアドレスの入力を求められるので、管理者のメールアドレスを入力 `email@address.com`

The Bitnami HTTPS Configuration Tool succeeded in modifying your installation.

The configuration report is shown below.

Backup files:
* /opt/bitnami/apache2/conf/httpd.conf.back.202005103222
* /opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf.back.202005103222
* /opt/bitnami/apache2/conf/bitnami/bitnami.conf.back.202005103222

Find more details in the log file:

/tmp/bncert-202001140617.log

If you find any issues, please check Bitnami Support forums at:

https://community.bitnami.com

証明書の更新について

上記ツールで設定すれば、cron jobも自動的に設定してくれます。
もし設定されているcron jobについて確認・編集したい場合は、以下のコマンドから可能です。

sudo crontab -u bitnami -l.

まとめ

ガッツリ解説記事を書こうと思ったら、ツールが用意されて拍子抜けしてしまった。。。
やっぱりbitnamiは楽。

3
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
3
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?