掲題の件で難航しております。
【サーバー情報】
さくらVPS
apache2.4.6
centos7.3.1611
WordPressで構築しているサイトです。
ーーーーーー
やったこと
ーーーーーー
【証明書の取得】
稼働しているapacheは停止してから行いました。
#下記のコマンドで取得を確認。 $ sudo ls -l /etc/letsencrypt/live/ほげほげ.com 合計 0 lrwxrwxrwx 1 root root 33 8月 28 04:29 2016 cert.pem -> ../../archive/ほげほげ.com/cert1.pem lrwxrwxrwx 1 root root 34 8月 28 04:29 2016 chain.pem -> ../../archive/ほげほげ.com/chain1.pem lrwxrwxrwx 1 root root 38 8月 28 04:29 2016 fullchain.pem -> ../../archive/ほげほげ.com/fullchain1.pem lrwxrwxrwx 1 root root 36 8月 28 04:29 2016 privkey.pem -> ../../archive/ほげほげ.com/privkey1.pem
【https通信を有効にする】
# ssl.confの編集(/etc/httpd/conf.d/ssl.conf) $ sudo /etc/httpd/conf.d/ssl.conf <VirtualHost *:443> DocumentRoot "/var/www/html/hogehoge" ServerName ほげほげ.com:443 # Server Certificate: # Point SSLCertificateFile at a PEM encoded certificate. If # the certificate is encrypted, then you will be prompted for a # pass phrase. Note that a kill -HUP will prompt again. A new # certificate can be generated using the genkey(1) command. SSLCertificateFile /etc/letsencrypt/live/ほげほげ.com/cert.pem # Server Private Key: # If the key is not combined with the certificate, use this # directive to point at the key file. Keep in mind that if # you've both a RSA and a DSA private key you can configure # both in parallel (to also allow the use of DSA ciphers, etc.) SSLCertificateKeyFile /etc/letsencrypt/live/ほげほげ.com/privkey.pem # Server Certificate Chain: # Point SSLCertificateChainFile at a file containing the # concatenation of PEM encoded CA certificates which form the # certificate chain for the server certificate. Alternatively # the referenced file can be the same as SSLCertificateFile # when the CA certificates are directly appended to the server # certificate for convinience. SSLCertificateChainFile /etc/letsencrypt/live/ほげほげ.com/chain.pem # Certificate Authority (CA): # Set the CA certificate verification path where to find CA # certificates for client authentication or alternatively one # huge file containing all of them (file must be PEM encoded) #SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
上記を設定後、apacheを再起動し、サイトにアクセスしてもhttpsになっておらず、通常のhttpのままです。
https:// でアクセスしても、「このサイトにアクセスできません」と表示されます。
どこに原因があるのかご教示頂けますとありがたいです。
追記:
apachectl -tで確認すると、Syntax OKとなります。
下記のブログを参考に設定しておりますが、
「応答時間が長すぎます」とほ表示になります。
https://blog.yagi2.com/2016/08/31/lets-encrypt.html
$ apachectl configtestで確認ところ、
SSLCertificateFile: file '/etc/letsencrypt/live/ほげほげ.com/cert.pem' does not exist o r is empty
と表示されます。
しかし、'/etc/letsencrypt/live/にはほげほげ.comは入っているのですが・・・・
suコマンドで確認すると、Syntax OKになります。
SSL_error_logファイルを確認すると、以下のerrorを発見しました。
[Thu Jan 19 03:47:28.752229 2017] [ssl:warn] [pid 10127] AH01909: RSA certificate configured for ほげほげ.com:443 does NOT include an ID which matches the server name
error_logから下記を確認しました。
[Sat Jan 21 14:06:48.809658 2017] [mpm_prefork:notice] [pid 15632] AH00170: caught SIGWINCH, shutting down gracefully [Sat Jan 21 14:06:49.900480 2017] [core:notice] [pid 15775] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0 [Sat Jan 21 14:06:49.901825 2017] [suexec:notice] [pid 15775] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Sat Jan 21 14:06:49.902687 2017] [ssl:warn] [pid 15775] AH01916: Init: (ik1-☓☓☓-☓☓☓☓.vs.sakura.ne.jp:443) You configured HTTP(80) on the standard HTTPS(443) port! [Sat Jan 21 14:06:49.972925 2017] [auth_digest:notice] [pid 15775] AH01757: generating s ecret for digest authentication ... [Sat Jan 21 14:06:49.973804 2017] [lbmethod_heartbeat:notice] [pid 15775] AH02282: No slotmem from mod_heartmonitor [Sat Jan 21 14:06:49.974669 2017] [ssl:warn] [pid 15775] AH01916: Init: (ik1-326-23165.v s.sakura.ne.jp:443) You configured HTTP(80) on the standard HTTPS(443) port! [Sat Jan 21 14:06:50.002990 2017] [mpm_prefork:notice] [pid 15775] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips PHP/7.0.14 configured -- resuming normal operations [Sat Jan 21 14:06:50.003084 2017] [core:notice] [pid 15775] AH00094: Command line: '/usr/sbin/httpd -D FOREG
回答4件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/01/16 06:30
2017/01/16 06:34
2017/01/16 09:05
2017/01/21 06:34 編集