.png)
私は使用していますhttps://www.sslshopper.com/ssl-checker.htmlサイトをチェックしようとしたところ、次のエラー メッセージが表示されて失敗しました:
None of the common names in the certificate match the name that was entered (example.net). You may receive an error when accessing this site in a web browser. It looks like you just need to add the "www." when accessing the site with SSL. Learn more about name mismatch errors.
私の000-default-le-ssl.conf
設定はこんな感じです:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ServerName example.net
ServerAlias www.example.net
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
Include /etc/letsencrypt/options-ssl-apache.conf
RewriteEngine on
RewriteCond %{SERVER_NAME} =example.net
RewriteRule ^ https://www.%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
SSLCertificateFile /etc/letsencrypt/live/www.example.net-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.example.net-0001/privkey.pem
</VirtualHost>
<VirtualHost *:80>
ServerName example.net
ServerAlias www.example.net
Redirect permanent / https://www.example.net/
</VirtualHost>
</IfModule>
<IfModule mod_ssl.c>
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
</VirtualHost>
SSLCertificateFile
にはしかなくwww.example.net
、 には が 1 つ欠けているからでしょうか?もしそうなら、この問題を回避するためexample.net
に へのリダイレクトを強制しようとしました。www.example.net
(更新: 以下で解決済み)
答え1
解決済み:Let's Encrypt 経由で再インストールしようとしましたsudo certbot --apache
が、尋ねられたときにWhich names would you like to activate HTTPS for?
両方のオプションを選択しました(以前はオプション1. example.net 2. www.example.net
のみを選択していたはずです)。www