teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

追記事項を編集しました

2018/12/14 07:13

投稿

hidepon
hidepon

スコア206

title CHANGED
File without changes
body CHANGED
@@ -12,6 +12,7 @@
12
12
  よろしくお願いいたします。
13
13
 
14
14
  (補足)
15
+ #インストール
15
16
  yum -y install epel-release
16
17
  yum -y install certbot python-certbot-apache
17
18
  curl https://dl.eff.org/certbot-auto -o /usr/bin/certbot-auto
@@ -38,9 +39,9 @@
38
39
  RewriteCond %{HTTPS} off
39
40
  RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
40
41
  </ifModule>
41
- 再起動
42
+ #再起動
42
43
  systemctl start httpd
43
44
 
44
- 定時自動更新
45
+ #定時自動更新
45
46
  crontab -u root -e
46
47
  00 04 01 * * certbot renew && systemctl restart httpd

1

設定事項を追記します

2018/12/14 07:13

投稿

hidepon
hidepon

スコア206

title CHANGED
File without changes
body CHANGED
@@ -9,4 +9,38 @@
9
9
  00 04 01 * * certbot renew && systemctl restart httpd
10
10
 
11
11
  ほかに設定が必要なのでしょうか?
12
- よろしくお願いいたします。
12
+ よろしくお願いいたします。
13
+
14
+ (補足)
15
+ yum -y install epel-release
16
+ yum -y install certbot python-certbot-apache
17
+ curl https://dl.eff.org/certbot-auto -o /usr/bin/certbot-auto
18
+ chmod 700 /usr/bin/certbot-auto
19
+ certbot-auto certonly --webroot -w /var/www/laravel/public -d hogehoge.jp --email hoge@hogehoge.jp
20
+ ls -l /etc/letsencrypt/live/hogehoge.jp/
21
+ #証明書設定
22
+ vi /etc/httpd/conf.d/ssl.conf
23
+ SSLCertificateFile /etc/letsencrypt/live/hogehoge.jp/cert.pem
24
+ SSLCertificateKeyFile /etc/letsencrypt/live/hogehoge.jp/privkey.pem
25
+ SSLCertificateChainFile /etc/letsencrypt/live/hogehoge.jp/chain.pem
26
+
27
+ systemctl stop httpd
28
+ systemctl start httpd
29
+ systemctl stop httpd
30
+ firewall-cmd --add-service=https --zone=public --permanent
31
+ firewall-cmd --reload
32
+
33
+ vi /etc/httpd/conf/httpd.conf
34
+ #追加
35
+ <ifModule mod_rewrite.c>
36
+ RewriteEngine On
37
+ LogLevel alert rewrite:trace3
38
+ RewriteCond %{HTTPS} off
39
+ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
40
+ </ifModule>
41
+ 再起動
42
+ systemctl start httpd
43
+
44
+ 定時自動更新
45
+ crontab -u root -e
46
+ 00 04 01 * * certbot renew && systemctl restart httpd