質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Apache

Apacheは、Apache HTTP Serverの略で、最も人気の高いWebサーバソフトウェアの一つです。安定性が高いオープンソースソフトウェアとして商用サイトから自宅サーバまで、多くのプラットフォーム向けに開発・配布されています。サーバーソフトウェアの不具合(NCSA httpd)を修正するパッチ(a patch)を集積、一つ独立したソフトウェアとして開発されました。

SSL

SSL(Secure Sockets Layer)とは、暗号化されたプロトコルで、インターネット上での通信セキュリティを提供しています。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

Q&A

3回答

8400閲覧

Let's encryptをリセットする方法

akkkkin

総合スコア83

Apache

Apacheは、Apache HTTP Serverの略で、最も人気の高いWebサーバソフトウェアの一つです。安定性が高いオープンソースソフトウェアとして商用サイトから自宅サーバまで、多くのプラットフォーム向けに開発・配布されています。サーバーソフトウェアの不具合(NCSA httpd)を修正するパッチ(a patch)を集積、一つ独立したソフトウェアとして開発されました。

SSL

SSL(Secure Sockets Layer)とは、暗号化されたプロトコルで、インターネット上での通信セキュリティを提供しています。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

1グッド

0クリップ

投稿2017/06/14 08:08

編集2022/01/12 10:55

Let's encrypt の更新期限が過ぎており、サイトが表示されなくなっていました。
そこで、サーバーをストップしてから更新のコマンド

sudo certbot renew

を打ったのですが、以下の結果が返ってきて更新できませんでした。

【質問】
======================
一度Let's encryptをリセットして初めから入れ直したいのですが、
入れ直すには何(ファイルやディレクトリ)を削除すればいいのでしょうか?
======================

以下に情報、やったことを掲載します。

システム情報
・os:centos7.3.161
・サーバー:apache2.4.6
・返ってきた結果

Saving debug log to /var/log/letsencrypt/letsencrypt.log ------------------------------------------------------------------------------- Processing /etc/letsencrypt/renewal/sample.com.conf ------------------------------------------------------------------------------- Cert is due for renewal, auto-renewing... Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org Renewing an existing certificate Performing the following challenges: tls-sni-01 challenge for sample.com Cleaning up challenges Attempting to renew cert from /etc/letsencrypt/renewal/sample.com.conf produced an unexpected error: Could not bind TCP port 443 because it is already in use by another process on this system (such as a web server). Please stop the program in question and then try again.. Skipping. All renewal attempts failed. The following certs could not be renewed: /etc/letsencrypt/live/sample.com/fullchain.pem (failure) 1 renew failure(s), 0 parse failure(s)

追記:サーバーを停止

service httpd stop

してから以下のコマンドを打ちました。

./certbot-auto renew --force-renewal

しかし、以下の結果が返ってきてどうやら更新できませんでした。

Saving debug log to /var/log/letsencrypt/letsencrypt.log ------------------------------------------------------------------------------- Processing /etc/letsencrypt/renewal/sample.com.conf ------------------------------------------------------------------------------- Renewing an existing certificate Performing the following challenges: tls-sni-01 challenge for sample.com Waiting for verification... Cleaning up challenges Attempting to renew cert from /etc/letsencrypt/renewal/sample.com.conf produced an unexpected error: Failed authorization procedure. sample.com (tls-sni-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: DNS problem: SERVFAIL looking up A for sample.com. Skipping. All renewal attempts failed. The following certs could not be renewed: /etc/letsencrypt/live/sample.com/fullchain.pem (failure) 1 renew failure(s), 0 parse failure(s) IMPORTANT NOTES: - The following errors were reported by the server: Domain: sample.com Type: connection Detail: DNS problem: SERVFAIL looking up A for sample.com To fix these errors, please make sure that your domain name was entered correctly and the DNS A record(s) for that domain contain(s) the right IP address. Additionally, please check that your computer has a publicly routable IP address and that no firewalls are preventing the server from communicating with the client. If you're using the webroot plugin, you should also verify that you are serving files from the webroot path you provided.

最初から設定しようと思ってやっていましたが、

certbot run --apache -d sample.com

のコマンド入力の結果が、

Saving debug log to /var/log/letsencrypt/letsencrypt.log Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org Cert is due for renewal, auto-renewing... Renewing an existing certificate Performing the following challenges: tls-sni-01 challenge for sample .com Waiting for verification... Cleaning up challenges Failed authorization procedure. sample.com (tls-sni-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: DNS problem: SERVFAIL looking up A for sample.com IMPORTANT NOTES: - The following errors were reported by the server: Domain: sample.com Type: connection Detail: DNS problem: SERVFAIL looking up A for sample.com To fix these errors, please make sure that your domain name was entered correctly and the DNS A record(s) for that domain contain(s) the right IP address. Additionally, please check that your computer has a publicly routable IP address and that no firewalls are preventing the server from communicating with the client. If you're using the webroot plugin, you should also verify that you are serving files from the webroot path you provided.

となり、エラーが返ってきました。

以上詳しい方がいらっしゃれば是非ともご教示いただければありがたいです。
何卒よろしくお願いいたします。

ikuwow👍を押しています

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答3

0

つい最近、私もやっちゃいましたw
多分ですが、期限切れの場合、renew では更新できません。
私は再取得で、問題を解決しました。
試してみて下さい。

追記
renew出来ないと断言してしまいましたが、間違った情報かもしれないです。
コメントにも記述しましたが、私の更新できなかった理由は、80 → 443 のリダイレクト設定だったかもしれないです。
検証できないため、曖昧なコメントとなり、申し訳ありません。

投稿2017/06/14 13:06

編集2017/06/14 14:26
退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

akkkkin

2017/06/14 13:11

ええ!?そうなんですか!
退会済みユーザー

退会済みユーザー

2017/06/14 13:16

同じエラーメッセージなので、多分、イケると思います。 エラーメッセージに騙されて、ドハマリしましたw DNSとか関係ないです。
akkkkin

2017/06/14 13:25

最初からやり直そうとおもってやっていると certbot run --apache -d sample.com のコマンド入力の結果が、 Saving debug log to /var/log/letsencrypt/letsencrypt.log Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org Cert is due for renewal, auto-renewing... Renewing an existing certificate Performing the following challenges: tls-sni-01 challenge for sample .com Waiting for verification... Cleaning up challenges Failed authorization procedure. sample.com (tls-sni-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: DNS problem: SERVFAIL looking up A for sample.com IMPORTANT NOTES: - The following errors were reported by the server: Domain: sample.com Type: connection Detail: DNS problem: SERVFAIL looking up A for sample.com To fix these errors, please make sure that your domain name was entered correctly and the DNS A record(s) for that domain contain(s) the right IP address. Additionally, please check that your computer has a publicly routable IP address and that no firewalls are preventing the server from communicating with the client. If you're using the webroot plugin, you should also verify that you are serving files from the webroot path you provided. とエラーが返ってくるのです。
退会済みユーザー

退会済みユーザー

2017/06/14 13:57

apache オプションは使用したことがないので適切な回答でないかもしれないですけど、私がハマったもう一点が、80 を 443 にリダイレクトしていたためでした。 webroot オプションでの話なので、ちょっと関係がないかもしれないです。 具体的にいうと、 ・webroot オプションで証明書導入 ・cron で更新ができることを確認 ・導入後、80→443 のリダイレクトを設定 ・ しばらくエラー出ず ・更新可能日時になり、renew が有効になった時、80でアクセスできずエラー ・放置してたため、期限切れ^^; ・renew しようとすると、質問にあるエラー発生 ・再取得しようとすると、別のエラー(コメントにあるようなエラーだったかも) ・80 のリダイレクト設定を外し、再取得 → 成功 でした。 apache オプションの挙動を追うつもりはないので、アドバイスできるのはここまでですが、参考になれば^^
退会済みユーザー

退会済みユーザー

2017/06/14 14:27 編集

ちょっとログを振り返って確認したのですが、もしかすると私の場合は 80 → 443 のほうが本命だったかもしれないです。 手順として、renew を諦めて、新規で取得を試みた時に、リダイレクト解除を行ったので、先にこちらを行っていれば、renew でも更新できていたかもしれないです。
akkkkin

2017/06/14 14:26

なるほどです。引き続き情報収集してみます。ありがとうございます。
guest

0

DNS周りのエラーが出ていますね。

更新しようとしている証明書ですが、サーバーから自身のグローバルIPアドレスを逆引き出来るか
確認してみてはどうでしょうか?

nslookup 取得ドメイン名

で結果が帰って来ない場合、/etc/hostsに書くと上手く行くかもしれません。

投稿2017/06/14 12:54

JunMatsumoto

総合スコア76

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

akkkkin

2017/06/14 13:10

コメントありがとうございます。 nslookup sample.com  とコマンドを入力しましたが、 コマンドが見つかりませんと表示されました。 /etc/hostsに書くというのはドメインを書けば良いのでしょうか。 どのように書けばいいのでしょうか?
akkkkin

2017/06/15 00:45

ちなみに現在の/etc/hostsのファイルの中は 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 となっています。
guest

0

renew の使い方と更新の自動化
によると、Web サーバーを停止してから行う必要があるようですね。

引数に Web サーバの 停止/開始のコマンドを渡すことで、停止時間を
必要最小限にする使用例もあるようです。ただ、初回の更新であれば、
手作業でやってから動作確認した方がよいかもしれませんね。

投稿2017/06/14 08:20

hotta

総合スコア1613

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

akkkkin

2017/06/14 08:33

コメントありがとうございます。サーバーを停止おこなったのですが更新できませんでした。詳細は追記しました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問