LoginSignup
17
16

More than 5 years have passed since last update.

無料のSSL証明書 [ Let's Encrypt ] を ubuntu にインストールする。

Last updated at Posted at 2016-02-18

WEBサーバーでPort:80とPort:443を有効にしておきます。
(自動更新用にPort:80のrootディレクトリは777とかに設定しておく。)

$ chmod -R 777 /var/www/public_html

letsencryptのダウンロードとインストールを実行します。

$ git clone https://github.com/letsencrypt/letsencrypt
$ ./letsencrypt/letsencrypt-auto

ドメイン名とかメールアドレスを入力してインストールが終わると証明書ファイルが以下のディレクトリに生成されます。

$ cd /etc/letsencrypt/live/YOUR_HOSTNAME/ ; ls

cert.pem
chain.pem
fullchain.pem
privkey.pem

自動更新を設定するためにクーロンを追加します。

$ crontab -e

以下の通り反映されました。(毎月1日に更新)

* * 1 * * /path_to_letsencrypt/letsencrypt-auto certonly --webroot -w /var/www/letsencrypt -d [YOURDOMAIN] --renew-by-default && service restart nginx

これで完了です。

17
16
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
17
16