Let's Encrypt 入れた&自動更新設定してある。
他のドメインを追加したい。
→証明書取り直しが手っ取り早かった
ほぼこれ通りに。
certbot の部分は certbot-autoで
失効処理 参考
certbot 入れ直し 参考
certbot-auto 実行
./certbot-auto certonly --webroot -w /var/www/html/フォルダ1 -d ドメイン1.com -w /var/www/html/フォルダ2 -d ドメイン2.com
こういうことだそうです
Webサーバ(Apache や nginx など)が動作している環境において、
https://letsencrypt.jp/usage/#ExecClientSoftware
複数のドメイン名に対応する1枚の証明書を取得する場合:
複数のドメイン名に対応する1枚の SSL/TLS サーバ証明書を取得する場合には、ドメイン名ごとに DocumentRoot が異なる場合があるため、それぞれのドメイン名に対応する DocumentRoot を個別に指定することができます。
複数のドメイン名を指定した場合、それぞれのドメイン名に対して、最後に指定した DocumentRoot --webroot-path (省略形 -w )が適用されます。
例えば、
certbot certonly --webroot -w /var/www/example/ -d www.example.com -d example.com -w /var/www/other -d other.example.net -d another.other.example.net
と指定した場合、指定した全てのドメイン名(www.example.com, example.com, other.example.net, another.other.example.net)に使用可能な1枚の SSL/TLS サーバ証明書が発行されます。
ドメイン使用権者の認証の際には、ドメイン名 www.example.com と example.com に対しては DocumentRoot /var/www/example/ が使用され、ドメイン名 other.example.net と another.other.example.net に対しては DocumentRoot /var/www/other が使用されます。
ひっかかりポイント
「DNS レコードやAレコードに問題ありますよ・・・・」
みたいなエラーメッセージが出がち
↓
最後にVirtual Host
<VirtualHost *:443> ServerAdmin root@ドメイン3.com DocumentRoot /var/www/html/フォルダ3 ServerName ドメイン3.com <Directory "/var/www/html/フォルダ3"> AllowOverride All </Directory> SSLEngine on SSLCertificateFile /etc/letsencrypt/live/ドメイン1.com/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/ドメイン1.com/privkey.pem SSLCertificateChainFile /etc/letsencrypt/live/ドメイン1.com/chain.pem </VirtualHost>