Lets’s Encrypt 別サーバで証明書を作成

CentOS6

現在Webサーバを運用しておりLets’s Encryptを利用しております。しばらく前に以下のタイトルのメールが届きました。

Let’s Encrypt certificate expiration notice for domain “xxxxxxxx.xxx.xxx”

英語のメールは基本的にスパム扱いにしているのですが、、確認したところ証明書がもうすぐ切れるとのこと。過去のメールを見ていると期限切れの10日前と1日前に送ってくれているようです。

それじゃ更新しようかと思い、ググって手順を思い出してみたところ、そういえばcerbot-autoは非推奨になっていてCentOS6だといろいろサポートがきれて環境が整えられないので別のサーバ(こっちはCentOS7)で作成してやった記憶が。。ということで一度CentOS7のサーバで証明書を作成しCentOS6のサーバに移設してあげることにします。

まず、作成用のサーバ(CentOS7)にログインし、

[root@xx]# certbot certonly --manual
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator manual, Installer None
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
Please enter in your domain name(s) (comma and/or space separated)  (Enter 'c'
to cancel): xxxxxxx.xxx.xxx  →ここで発行したいドメインの入力
Cert is due for renewal, auto-renewing...
Renewing an existing certificate for xxxxxxx.xxx.xxx
Performing the following challenges:
http-01 challenge for xxxxxxx.xxx.xxx
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Create a file containing just this data:

kD02ygKgkYkhJIN0Zmpew4LKkrAylv6MoTCSWbVdeMT.ePD1FfCxTPqmNs69UkmU8TXIHlbQfredCv-vUk_e0jw

And make it available on your web server at this URL:

http://xxxxxxxxx.xxx.xxx/.well-known/acme-challenge/kD02ygKgkYkhJIN0Zmpew4LKkrAylv6MoTCSWbVdeMT
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Press Enter to Continue

ここで実際にSSLを利用するサーバにはいって上記のランダムの文字列を.well-known/acme-challenge配下に作成してあげます。(外部からアクセスできるルートに)

設置し終わったらSSLを作っているサーバにもどって続きを行うためEnterを押します。

Press Enter to Continue
→ここで止まっているのでEnterを入力
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/xxxxxxx.xxx.xxx/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/xxxxxxx.xxx.xxx/privkey.pem
   Your certificate will expire on 2022-01-21. To obtain a new or
   tweaked version of this certificate in the future, simply run
   certbot again. To non-interactively renew *all* of your
   certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

成功したようなので /etc/letsencrypt/live/xxxxxxx.xxx.xxx/ 配下に作成された

certxx.pem chainxx.pem fullchainxx.pem privkeyxx.pemを実際に使うサーバのarchiveに設置してliveのディレクトリのシンボリックリングを新しいファイルを見るように変更して、apacheを再起動します。

で、自分のサイトにブラウザでアクセスして証明書を確認して証明書の期限が延長されていればOKです

コメント

タイトルとURLをコピーしました