先ず、certbot をインストールします
cd /opt
mkdir certbot
cd /opt/certbot
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
これで「 certbot-auto 」を使うことができます
「./ certbot-auto 」って叩くと必要なパッケージをインストール・更新してくれますので超簡単
後はメッセージに従っていけばOKです
メインのドメインに加えて複数のバーチャルドメインも一枚の証明書に纏めてくれます
./certbot-auto
・
・
・
複数のドメインがあると
Which names would you like to activate HTTPS for?
因みに手動更新は
cd /opt/certbot
これで「 certbot-auto 」を使うことができます
「./ certbot-auto 」って叩くと必要なパッケージをインストール・更新してくれますので超簡単

後はメッセージに従っていけばOKです
メインのドメインに加えて複数のバーチャルドメインも一枚の証明書に纏めてくれます
./certbot-auto
・
・
・
複数のドメインがあると
Which names would you like to activate HTTPS for?
- – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
1: www.aaa.com
2: www.bbb.com
3: www.ccc.com
- – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter ‘c’ to cancel): 1,2,3
等と選択して証明書が作成されるまで待つ。。。
( /etc/httpd/cof.d にリダイレクト設定を置くので 1 を選択した)
これで「/etc/letsencrypt/live/www.aaa.com」等のフォルダが作成されその中に「cert.pem」「privkey.pem」「chain.pem」が作成されていれば OK です
あとは「service httpd restart」で apache を再起動して動作確認します
で、
etc/httpd/cof.d にリダイレクト設定を置いて cron を使って自動更新を行えば OK
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
1: No redirect – Make no further changes to the webserver configuration.
2: Redirect – Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you’re confident your site works on HTTPS. You can undo this
change by editing your web server’s configuration.
- – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Select the appropriate number [1-2] then [enter] (press ‘c’ to cancel):
と聞いてくるので 1 or 2 を選択する
( /etc/httpd/cof.d にリダイレクト設定を置くので 1 を選択した)
これで「/etc/letsencrypt/live/www.aaa.com」等のフォルダが作成されその中に「cert.pem」「privkey.pem」「chain.pem」が作成されていれば OK です

あとは「service httpd restart」で apache を再起動して動作確認します
因みに手動更新は
cd /opt/certbot
./certbot-auto renew でOK
。。。終わり
