Certbot installed two lets-encrypt SSL certificates but none working
On my AWS EC2 Ubuntu 18
Three files are as follows:
/etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =sub1.domain.net [OR]
RewriteCond %{SERVER_NAME} =sub2.domain.net
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
/etc/apache2/sites-available/000-default-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
SSLEngine on
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerName sub1.domain.net
Include /etc/letsencrypt/options-ssl-apache.conf
ServerAlias sub2.domain.net
SSLCertificateFile /etc/letsencrypt/live/sub1.domain.net/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/sub2.domain.net/privkey.pem
</VirtualHost>
</IfModule>
/etc/apache2/sites-available/default-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
/var/log/letsencrypt/letsencrypt.log
2018-12-21 04:51:46,545:DEBUG:certbot.reverter:Creating backup of /etc/apache2/sites-enabled/000-default-le-ssl.conf
2018-12-21 04:51:46,744:INFO:certbot_apache.configurator:Deploying Certificate to VirtualHost /etc/apache2/sites-enabled/000-default-le-ssl.conf
netstat -ltnp | grep ':80\|:443'
tcp6 0 0 :::443 :::* LISTEN 1529/apache2
tcp6 0 0 :::80 :::* LISTEN 1529/apache2
I tried everything but the outside world doesn't find any certificate. I didn't put any entry into this file: /etc/apache2/apache2.conf
subdomains were taken from free DNS dynu dot com