Let’sEncrypt の設定をしました。
設定の完了後にhttps から始まる形でアクセスをできることを確認しました。
そこで次の段階として
自動的に期限切れの状態から更新して利用できるようにと次のcron を設定したのですが、なぜか
自動更新されず、「セキュリティーの保護がなされていません」と表示されました。
どこが悪いのでしょうか?
00 04 01 * * certbot renew && systemctl restart httpd
ほかに設定が必要なのでしょうか?
よろしくお願いいたします。
(補足)
#インストール
yum -y install epel-release
yum -y install certbot python-certbot-apache
curl https://dl.eff.org/certbot-auto -o /usr/bin/certbot-auto
chmod 700 /usr/bin/certbot-auto
certbot-auto certonly --webroot -w /var/www/laravel/public -d hogehoge.jp --email hoge@hogehoge.jp
ls -l /etc/letsencrypt/live/hogehoge.jp/
#証明書設定
vi /etc/httpd/conf.d/ssl.conf
SSLCertificateFile /etc/letsencrypt/live/hogehoge.jp/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/hogehoge.jp/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/hogehoge.jp/chain.pem
systemctl stop httpd
systemctl start httpd
systemctl stop httpd
firewall-cmd --add-service=https --zone=public --permanent
firewall-cmd --reload
vi /etc/httpd/conf/httpd.conf
#追加
<ifModule mod_rewrite.c>
RewriteEngine On
LogLevel alert rewrite:trace3
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</ifModule>
#再起動
systemctl start httpd
#定時自動更新
crontab -u root -e
00 04 01 * * certbot renew && systemctl restart httpd

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/12/14 06:51
2018/12/14 07:14