I run the command sudo certbot certonly -d example.com -d www.example.com - sub.example.com
and get the following error:
Certbot failed to authenticate some domains (authenticator: apache). The Certificate Authority reported these problems:
Domain: sub.example.com
Type: unauthorized
Detail: 12.34.56.78: Invalid response from https://www.example.com: "rn<!DOCTYPE html>rnrnrn<html xmlns="http://www.w3.org/1999/xhtml" lang="en">rn<head>rn"
SSL was configured for the root domain and ‘www’ previously but I am trying to add the additional subdomain. All of the domains can be reached through a browser but sub.domain.com is the only one that says not secure.
/atc/apache2/sites-availabel/default-ssl.conf looks like this:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
ServerAlias www.example.com, sub.example.com
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
</VirtualHost>
</IfModule>
Am I missing something here or should I be doing something else?