0
0

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 5 years have passed since last update.

FacebookシェアにOGPが反映されない(Let's Encryptの中間証明書)

Posted at

あるサイトにて、FacebookでのシェアのときにOGPが反映されないことがあり、いろいろ調べたのでメモ。

SSL/TLS関連のエラー

SSL/TLSの設定にエラーがあると(一見するとちゃんとhttpsでアクセスできていたとしても)、シェア時にエラーになりOGPが反映されないらしい。
勉強を兼ねて自分でLet's EncryptでSSL/TLSを設定したサーバだったので、いろいろ不備があったらしい。

環境

  • AWS EC2
  • Amazon Linux
  • Apache/2.4.39
  • Let's Encrypt

対処内容

正直なところ、「こうやったらできた。」というだけで、すべて理解しているわけではないので注意。

関連するプログラムをアップデート

$ sudo yum update openssl
$ sudo yum update httpd

中間証明書

どうも中間証明書が設定されていないとだめ?っぽいエラーがでていたので、設定してみる。
ssl.confを開いて編集する。

$ sudo vi /etc/httpd/conf.d/ssl.conf
ssl.conf
SSLCertificateChainFile /etc/letsencrypt/live/xxx.xxxxxx.xx/chain.pem

上記の場所を探してコメントアウトして chain.pem の場所を設定。
(xxx..のところは、SSLの対象ドメイン名と同名のディレクトリ)
自分の場合は、そのままコメントアウトすればOKでした。

上記を書き換えて、Apach再起動したら、ちゃんとシェアしたときにOGPが反映されるようになりました。

$ sudo service httpd reload

ただ、かなり手探りなのと知識不足も有り、これが正しい方向かはまだ不安があります。

参考サイト

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?