Certificate renewed but didn't update on the website

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:mail.alliedvaughndam.com

I ran this command: sudo service apache2 stop
sudo certbot renew
sudo service apache2 start

It produced this output:When I entered sudo certbot renew it produced the following information:

My web server is (include version):apache2 2.4.57

The operating system my web server runs on is (include version): Ubuntu 20 LTS

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don't know): Yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 2.11.0

I did try to reload apache2 and even rebooted my server this morning, but the website still has the old certificate listed even though if I look up my certificate in the server it said the expiration date is 11-9-2024

1 Like

Hi :slightly_smiling_face:

I'm willing to bet that your Apache configuration is pointing to an older certificate.

What are the outputs of these commands?

sudo certbot certificates
sudo apachectl -S
4 Likes
illkarl@mail:~$ sudo certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Renewal configuration file /etc/letsencrypt/renewal/mail.alliedvaughndam.com-0001.conf produced an unexpected error: error parsing /etc/letsencrypt/renewal/mail.alliedvaughndam.com-0001.conf. Skipping.
Renewal configuration file /etc/letsencrypt/renewal/mail.alliedvaughndam.com.conf produced an unexpected error: error parsing /etc/letsencrypt/renewal/mail.alliedvaughndam.com.conf. Skipping.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following matching certs:
 Certificate Name: mail.alliedvaughndam.com-0002
 Serial Number: 3e5bfa7c77b95cdb437a9166ba9569f2d22
 Key Type: RSA
 Domains: mail.alliedvaughndam.com
 Expiry Date: 2024-11-09 12:12:51+00:00 (VALID: 88 days)
 Certificate Path: /etc/letsencrypt/live/mail.alliedvaughndam.com-0002/fullchain.pem
 Private Key Path: /etc/letsencrypt/live/mail.alliedvaughndam.com-0002/privkey.pem

The following renewal configurations were invalid:
 /etc/letsencrypt/renewal/mail.alliedvaughndam.com-0001.conf
 /etc/letsencrypt/renewal/mail.alliedvaughndam.com.conf
illkarl@mail:~$ sudo apachectl -S
VirtualHost configuration:
*:443 mail.alliedvaughndam.com (/etc/apache2/sites-enabled/default-ssl.conf:2)
*:80 is a NameVirtualHost
 default server mail.alliedvaughndam.com (/etc/apache2/sites-enabled/000-default.conf:1)
 port 80 namevhost mail.alliedvaughndam.com (/etc/apache2/sites-enabled/000-default.conf:1)
 port 80 namevhost mail.alliedvaughndam.com (/etc/apache2/sites-enabled/postfixadmin.conf:1)
 port 80 namevhost mail.alliedvaughndam.com (/etc/apache2/sites-enabled/roundcube.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33
1 Like

What are the outputs of these commands?

sudo cat /etc/apache2/sites-enabled/default-ssl.conf
sudo cat /etc/apache2/sites-enabled/000-default.conf
sudo cat /etc/apache2/sites-enabled/postfixadmin.conf
sudo cat /etc/apache2/sites-enabled/roundcube.conf
4 Likes

sudo cat /etc/apache2/sites-enabled/default-ssl.conf

<IfModule mod_ssl.c>
  <VirtualHost _default_:443>
    ServerName mail.alliedvaughndam.com
    ServerAdmin webmaster@localhost

    # Set the HTTP Strict Transport Security (HSTS) header to guarantee
    # HTTPS for 1 Year, including subdomains, and allow this site to be
    # added to the preload list.
    #
    # Do NOT enable this until you have the final SSL certificate in
    # in place. You can get stuck.
    Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"

    # Prevent clickjacking by controlling who can put the site into a
    # frame. Only needed for text/html, but doesn't hurt to be applied
    # generally.
    Header set X-Frame-Options "SAMEORIGIN"

    # Prevent mime based attacks by telling browsers that support it
    # to use the declared mime type regardless of what the content looks
    # like.
    Header set X-Content-Type-Options "nosniff"

    DocumentRoot /var/www/html
    <Directory "/var/www/html">
      Options FollowSymLinks
      AllowOverride All
    </Directory>

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    LogLevel warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf

    #   SSL Engine Switch:
    #   Enable/Disable SSL for this virtual host.
    SSLEngine on

    #   A self-signed (snakeoil) certificate can be created by installing
    #   the ssl-cert package. See
    #   /usr/share/doc/apache2/README.Debian.gz for more info.
    #   If both key and certificate are stored in the same file, only the
    #   SSLCertificateFile directive is needed.
    # Use the SnakeOil Certificates
    # SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
    # SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
    # Use the Let's Encrypt certificate.
    SSLCertificateFile    /etc/letsencrypt/live/mail.alliedvaughndam.com/cert.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/mail.alliedvaughndam.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/apache2/ssl.crt/server-ca.crt
    # Use the Let's Encrypt certificate.
    SSLCertificateChainFile /etc/letsencrypt/live/mail.alliedvaughndam.com/fullchain.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)
    #   Note: Inside SSLCACertificatePath you need hash symlinks
    #    to point to the certificate files. Use the provided
    #    Makefile to update the hash symlinks after changes.
    #SSLCACertificatePath /etc/ssl/certs/
    #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt

    #   Certificate Revocation Lists (CRL):
    #   Set the CA revocation path where to find CA CRLs for client
    #   authentication or alternatively one huge file containing all
    #   of them (file must be PEM encoded)
    #   Note: Inside SSLCARevocationPath you need hash symlinks
    #    to point to the certificate files. Use the provided
    #    Makefile to update the hash symlinks after changes.
    #SSLCARevocationPath /etc/apache2/ssl.crl/
    #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl

    #   Client Authentication (Type):
    #   Client certificate verification type and depth.  Types are
    #   none, optional, require and optional_no_ca.  Depth is a
    #   number which specifies how deeply to verify the certificate
    #   issuer chain before deciding the certificate is not valid.
    #SSLVerifyClient require
    #SSLVerifyDepth  10

    #   SSL Engine Options:
    #   Set various options for the SSL engine.
    #   o FakeBasicAuth:
    #  Translate the client X.509 into a Basic Authorisation.  This means that
    #  the standard Auth/DBMAuth methods can be used for access control.  The
    #  user name is the `one line' version of the client's X.509 certificate.
    #  Note that no password is obtained from the user. Every entry in the user
    #  file needs this password: `xxj31ZMTZzkVA'.
    #   o ExportCertData:
    #  This exports two additional environment variables: SSL_CLIENT_CERT and
    #  SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
    #  server (always existing) and the client (only existing when client
    #  authentication is used). This can be used to import the certificates
    #  into CGI scripts.
    #   o StdEnvVars:
    #  This exports the standard SSL/TLS related `SSL_*' environment variables.
    #  Per default this exportation is switched off for performance reasons,
    #  because the extraction step is an expensive operation and is usually
    #  useless for serving static content. So one usually enables the
    #  exportation for CGI and SSI requests only.
    #   o OptRenegotiate:
    #  This enables optimized SSL connection renegotiation handling when SSL
    #  directives are used in per-directory context.
    #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
    <FilesMatch "\.(cgi|shtml|phtml|php)$">
        SSLOptions +StdEnvVars
    </FilesMatch>
    # <Directory /usr/lib/cgi-bin>
        # SSLOptions +StdEnvVars
    # </Directory>
    <Directory "/var/www/html">
       SSLOptions +StdEnvVars
    </Directory>

    #   SSL Protocol Adjustments:
    #   The safe and default but still SSL/TLS standard compliant shutdown
    #   approach is that mod_ssl sends the close notify alert but doesn't wait for
    #   the close notify alert from client. When you need a different shutdown
    #   approach you can use one of the following variables:
    #   o ssl-unclean-shutdown:
    #  This forces an unclean shutdown when the connection is closed, i.e. no
    #  SSL close notify alert is send or allowed to received.  This violates
    #  the SSL/TLS standard but is needed for some brain-dead browsers. Use
    #  this when you receive I/O errors because of the standard approach where
    #  mod_ssl sends the close notify alert.
    #   o ssl-accurate-shutdown:
    #  This forces an accurate shutdown when the connection is closed, i.e. a
    #  SSL close notify alert is send and mod_ssl waits for the close notify
    #  alert of the client. This is 100% SSL/TLS standard compliant, but in
    #  practice often causes hanging connections with brain-dead browsers. Use
    #  this only for browsers where you know that their SSL implementation
    #  works correctly.
    #   Notice: Most problems of broken clients are also related to the HTTP
    #   keep-alive facility, so you usually additionally want to disable
    #   keep-alive for those clients, too. Use variable "nokeepalive" for this.
    #   Similarly, one has to force some clients to use HTTP/1.0 to workaround
    #   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
    #   "force-response-1.0" for this.
    # BrowserMatch "MSIE [2-6]" \
    #         nokeepalive ssl-unclean-shutdown \
    #         downgrade-1.0 force-response-1.0
    # <Location /phpldapadmin>
    #   AuthType Basic
    #   AuthName "Restricted Files"
    #   # AuthUserFile /etc/apache2/htpasswd
    #   Require valid-user
    # </Location>


  </VirtualHost>
</IfModule>

sudo cat /etc/apache2/sites-enabled/000-default.conf

<VirtualHost *:80>
  # The ServerName directive sets the request scheme, hostname and port that
  # the server uses to identify itself. This is used when creating
  # redirection URLs. In the context of virtual hosts, the ServerName
  # specifies what hostname must appear in the request's Host: header to
  # match this virtual host. For the default virtual host (this file) this
  # value is not decisive as it is used as a last resort host regardless.
  # However, you must set it for any further virtual host explicitly.
  #ServerName www.example.com

  ServerName mail.alliedvaughndam.com
  ServerAdmin webmaster@localhost
  DocumentRoot /var/www/html
  # Redirect permanent /avldap https://127.0.0.1/phpldapadmin
  <Directory "/var/www/html">
      Options FollowSymLinks
      AllowOverride All
  </Directory>

  # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
  # error, crit, alert, emerg.
  # It is also possible to configure the loglevel for particular
  # modules, e.g.
  LogLevel warn

  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined

  # For most configuration files from conf-available/, which are
  # enabled or disabled at a global level, it is possible to
  # include a line for only one particular virtual host. For example the
  # following line enables the CGI configuration for this host only
  # after it has been globally disabled with "a2disconf".
  #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

sudo cat /etc/apache2/sites-enabled/postfixadmin.conf

<VirtualHost *:80>
  ServerName mail.alliedvaughndam.com
  ServerAdmin admin@alliedvaughndam.com
  DocumentRoot /var/www/html/postfixadmin

  ErrorLog ${APACHE_LOG_DIR}/postfixadmin_error.log
  CustomLog ${APACHE_LOG_DIR}/postfixadmin_access.log combined

  <Directory /var/www/html/postfixadmin>
    Options -Indexes
    AllowOverride All
    Order deny,allow
    deny from all
    allow from 10.21.21.120
  </Directory>
</VirtualHost>

sudo cat /etc/apache2/sites-enabled/roundcube.conf

<VirtualHost *:80>
  ServerName mail.alliedvaughndam.com
  ServerAdmin admin@alliedvaughndam.com
  DocumentRoot /var/www/html/roundcube

  ErrorLog ${APACHE_LOG_DIR}/roundcube_error.log
  CustomLog ${APACHE_LOG_DIR}/roundcube_access.log combined

  <Directory /var/www/html/roundcube>
    Options -Indexes
    AllowOverride All
    Order allow,deny
    allow from all
  </Directory>
</VirtualHost>
1 Like

The above -0002 cert is the only working cert profile you have. Yet, below, your Apache is referring to one of the (now broken) cert profiles. The easiest way forward is to manually change your config file

/etc/apache2/sites-enabled/default-ssl.conf

And modify these 2 lines

SSLCertificateFile    /etc/letsencrypt/live/mail.alliedvaughndam.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mail.alliedvaughndam.com/privkey.pem

to look like this (changing file path and using fullchain.pem)

SSLCertificateFile    /etc/letsencrypt/live/mail.alliedvaughndam.com-0002/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mail.alliedvaughndam.com-0002/privkey.pem

and remove this ChainFile line completely (it is deprecated and the full chain is already set in new SSLCertificateFile above

SSLCertificateChainFile /etc/letsencrypt/live/mail.alliedvaughndam.com/fullchain.pem

Once those are changed and Apache reloaded let us know. There are other things to get fixed

  • Removing the broken cert renewal profiles
  • Changing standalone to use certonly --apache
  • Removing duplicate VirtualHosts for port 80
4 Likes

After making the changes yesterday, I realized the apache2 service wasn't running and wouldn't restart. I uninstalled Apache2 from the server this morning but had a heck of a time getting it to re-installed. Long story short, I successfully got Apache2 re-installed around 3:15pm today. Verified the service was running. Notice the certificate on the site still hadn't updated so I reloaded apache2 and I still don't see the new certificate on the website. Stills shows the old one with expiration date of September 6th.

Okay. Let's start again. We need to check which certificate that Apache is configured to use.

Please show output of this to show your current VirtualHosts

sudo apache2ctl -t -D DUMP_VHOSTS
4 Likes
illkarl@mail:~$ sudo apache2ctl -t -D DUMP_VHOSTS
VirtualHost configuration:
*:80 mail.alliedvaughndam.com (/etc/apache2/sites-enabled/000-default.conf:1)
1 Like

Okay. I don't see a VirtualHost for port 443 at all. You used to have one.

You said the certificate on your site still hasn't updated after this re-install

What is the URL that is failing? I don't see how you can even connect using HTTPS on port 443.

I get this

curl -i https://mail.alliedvaughndam.com
curl: (7) Failed to connect to mail.alliedvaughndam.com port 443 after 32 ms: 
Connection refused
4 Likes

The certificate for the site is still valid until Friday, September 6th around 2am.

I can only access the site while in the office or when I am connected to VPN because of our firewall.

And you are sure you are connecting to the same Apache with the same config you just showed? Because there was no VirtualHost defined except for port 80 in that one

What does this say

sudo grep -Ri SSLCertificateFile /etc/apache2
4 Likes

So through Microsoft Edge browser I can connect to the website but I think the reason I am able to connect through Microsoft Edge is because it is bookmark. When I go through Google Chrome I am unable to get to the website and the website is not bookmark in Google Chrome.

root@mail:/home/illkarl# sudo grep -Ri SSLCertificateFile /etc/apache2
/etc/apache2/sites-enabled/default-ssl.conf.190403: # SSLCertificateFile directive is needed.
/etc/apache2/sites-enabled/default-ssl.conf.190403: SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
/etc/apache2/sites-enabled/default-ssl.conf.190403: # SSLCertificateFile /etc/letsencrypt/live/mail.alliedvaughndam.com/cert.pem
/etc/apache2/sites-enabled/default-ssl.conf.190403: # the referenced file can be the same as SSLCertificateFile
/etc/apache2/sites-enabled/default-ssl.conf221101mm: # SSLCertificateFile directive is needed.
/etc/apache2/sites-enabled/default-ssl.conf221101mm: # SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
/etc/apache2/sites-enabled/default-ssl.conf221101mm: SSLCertificateFile /etc/letsencrypt/live/mail.alliedvaughndam.com/cert.pem
/etc/apache2/sites-enabled/default-ssl.conf221101mm: # the referenced file can be the same as SSLCertificateFile
/etc/apache2/sites-enabled/default-ssl.conf.orig: # SSLCertificateFile directive is needed.
/etc/apache2/sites-enabled/default-ssl.conf.orig: SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
/etc/apache2/sites-enabled/default-ssl.conf.orig: # SSLCertificateFile /etc/letsencrypt/live/mail.alliedvaughndam.com/cert.pem
/etc/apache2/sites-enabled/default-ssl.conf.orig: # the referenced file can be the same as SSLCertificateFile
/etc/apache2/sites-enabled/default-ssl.conf.orig221113mm: # SSLCertificateFile directive is needed.
/etc/apache2/sites-enabled/default-ssl.conf.orig221113mm: SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
/etc/apache2/sites-enabled/default-ssl.conf.orig221113mm: # SSLCertificateFile /etc/letsencrypt/live/mail.alliedvaughndam.com/cert.pem
/etc/apache2/sites-enabled/default-ssl.conf.orig221113mm: # the referenced file can be the same as SSLCertificateFile
/etc/apache2/sites-enabled/default-ssl.conf: # SSLCertificateFile directive is needed.
/etc/apache2/sites-enabled/default-ssl.conf: # SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
/etc/apache2/sites-enabled/default-ssl.conf: SSLCertificateFile /etc/letsencrypt/live/mail.alliedvaughndam.com-002/fullchain.pem
/etc/apache2/sites-enabled/default-ssl.conf: # the referenced file can be the same as SSLCertificateFile
/etc/apache2/sites-enabled/default-ssl.conf.190411: # SSLCertificateFile directive is needed.
/etc/apache2/sites-enabled/default-ssl.conf.190411: SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
/etc/apache2/sites-enabled/default-ssl.conf.190411: # SSLCertificateFile /etc/letsencrypt/live/mail.alliedvaughndam.com/cert.pem
/etc/apache2/sites-enabled/default-ssl.conf.190411: # the referenced file can be the same as SSLCertificateFile
/etc/apache2/sites-available/default-ssl.conf.190410: # SSLCertificateFile directive is needed.
/etc/apache2/sites-available/default-ssl.conf.190410: SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
/etc/apache2/sites-available/default-ssl.conf.190410: # SSLCertificateFile /etc/letsencrypt/live/mail.alliedvaughndam.com/cert.pem
/etc/apache2/sites-available/default-ssl.conf.190410: # the referenced file can be the same as SSLCertificateFile
/etc/apache2/sites-available/default-ssl.conf.190321: # SSLCertificateFile directive is needed.
/etc/apache2/sites-available/default-ssl.conf.190321: SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
/etc/apache2/sites-available/default-ssl.conf.190321: # the referenced file can be the same as SSLCertificateFile
/etc/apache2/sites-available/default-ssl.conf.orig: # SSLCertificateFile directive is needed.
/etc/apache2/sites-available/default-ssl.conf.orig: SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
/etc/apache2/sites-available/default-ssl.conf.orig: # the referenced file can be the same as SSLCertificateFile
/etc/apache2/sites-available/default-ssl.conf: # SSLCertificateFile directive is needed.
/etc/apache2/sites-available/default-ssl.conf: SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
/etc/apache2/sites-available/default-ssl.conf: # the referenced file can be the same as SSLCertificateFile

Hmm. It looks like you have a VirtualHost defined in your default-ssl.conf file but none showed in that DUMP_VHOSTS output.

Would you post contents of this file?

/etc/apache2/sites-enabled/default-ssl.conf
3 Likes

/etc/apache2/sites-enabled/default-ssl.conf

    # This exports the standard SSL/TLS related `SSL_*' environment variables.
    # Per default this exportation is switched off for performance reasons,
    # because the extraction step is an expensive operation and is usually
    # useless for serving static content. So one usually enables the
    # exportation for CGI and SSI requests only.
    # o OptRenegotiate:
    # This enables optimized SSL connection renegotiation handling when SSL
    # directives are used in per-directory context.
    #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
    <FilesMatch "\.(cgi|shtml|phtml|php)$">
    SSLOptions +StdEnvVars
    </FilesMatch>
    # <Directory /usr/lib/cgi-bin>
    # SSLOptions +StdEnvVars
    # </Directory>
    <Directory "/var/www/html">
     SSLOptions +StdEnvVars
    </Directory>

    # SSL Protocol Adjustments:
    # The safe and default but still SSL/TLS standard compliant shutdown
    # approach is that mod_ssl sends the close notify alert but doesn't wait for
    # the close notify alert from client. When you need a different shutdown
    # approach you can use one of the following variables:
    # o ssl-unclean-shutdown:
    # This forces an unclean shutdown when the connection is closed, i.e. no
    # SSL close notify alert is send or allowed to received.  This violates
    # the SSL/TLS standard but is needed for some brain-dead browsers. Use
    # this when you receive I/O errors because of the standard approach where
    # mod_ssl sends the close notify alert.
    # o ssl-accurate-shutdown:
    # This forces an accurate shutdown when the connection is closed, i.e. a
    # SSL close notify alert is send and mod_ssl waits for the close notify
    # alert of the client. This is 100% SSL/TLS standard compliant, but in
    # practice often causes hanging connections with brain-dead browsers. Use
    # this only for browsers where you know that their SSL implementation
    # works correctly.
    # Notice: Most problems of broken clients are also related to the HTTP
    # keep-alive facility, so you usually additionally want to disable
    # keep-alive for those clients, too. Use variable "nokeepalive" for this.
    # Similarly, one has to force some clients to use HTTP/1.0 to workaround
    # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
    # "force-response-1.0" for this.
    # BrowserMatch "MSIE [2-6]" \
    # nokeepalive ssl-unclean-shutdown \
    # downgrade-1.0 force-response-1.0
    # <Location /phpldapadmin>
    # AuthType Basic
    # AuthName "Restricted Files"
    # # AuthUserFile /etc/apache2/htpasswd
    # Require valid-user
    # </Location>
  </VirtualHost>
</IfModule>

I am also including an updated file that was modified on November 13, 2022 by my predecessor. The below might be the one you are looking for. This is the last time the file was modified.

/etc/apache2/sites-enabled/default-ssl.conf.orig221113mm

<IfModule mod_ssl.c>
  <VirtualHost _default_:443>
    ServerName mail.alliedvaughndam.com
    ServerAdmin webmaster@localhost

    # Set the HTTP Strict Transport Security (HSTS) header to guarantee
    # HTTPS for 1 Year, including subdomains, and allow this site to be
    # added to the preload list.
    #
    # Do NOT enable this until you have the final SSL certificate in
    # in place. You can get stuck.
    Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"

    # Prevent clickjacking by controlling who can put the site into a
    # frame. Only needed for text/html, but doesn't hurt to be applied
    # generally.
    Header set X-Frame-Options "SAMEORIGIN"

    # Prevent mime based attacks by telling browsers that support it
    # to use the declared mime type regardless of what the content looks
    # like.
    Header set X-Content-Type-Options "nosniff"

    DocumentRoot /var/www/html
    <Directory "/var/www/html">
    Options FollowSymLinks
    AllowOverride All
    </Directory>

    DocumentRoot /var/www/html

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    LogLevel warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf

    # SSL Engine Switch:
    # Enable/Disable SSL for this virtual host.
    SSLEngine on

    # A self-signed (snakeoil) certificate can be created by installing
    # the ssl-cert package. See
    # /usr/share/doc/apache2/README.Debian.gz for more info.
    # If both key and certificate are stored in the same file, only the
    # SSLCertificateFile directive is needed.
    # Use the Let's Encrypt certificate.
    SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
    SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

You didn't show everything at the beginning of that default-ssl.conf

Notice there are ending tags for VirtualHost and IfModule but no beginning tags

Also, that conf.orig file should not be in your sites-enabled folder. It is generally bad practice to put backup items there. And, if the include for the that folder in your main apache conf picks it up you can get duplicated or wrong info active in the system.

3 Likes

This was setup by my predecessor and I have never made any changes to these files or save copies of them in the same directory.

I believe I capture the entire original file this time around.

<IfModule mod_ssl.c>
  <VirtualHost _default_:443>
    ServerName mail.alliedvaughndam.com
    ServerAdmin webmaster@localhost

    # Set the HTTP Strict Transport Security (HSTS) header to guarantee
    # HTTPS for 1 Year, including subdomains, and allow this site to be
    # added to the preload list.
    #
    # Do NOT enable this until you have the final SSL certificate in
    # in place. You can get stuck.
    Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"

    # Prevent clickjacking by controlling who can put the site into a
    # frame. Only needed for text/html, but doesn't hurt to be applied
    # generally.
    Header set X-Frame-Options "SAMEORIGIN"

    # Prevent mime based attacks by telling browsers that support it
    # to use the declared mime type regardless of what the content looks
    # like.
    Header set X-Content-Type-Options "nosniff"

    DocumentRoot /var/www/html
    <Directory "/var/www/html">
      Options FollowSymLinks
      AllowOverride All
    </Directory>

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    LogLevel warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf

    #   SSL Engine Switch:
    #   Enable/Disable SSL for this virtual host.
    SSLEngine on

    #   A self-signed (snakeoil) certificate can be created by installing
    #   the ssl-cert package. See
    #   /usr/share/doc/apache2/README.Debian.gz for more info.
    #   If both key and certificate are stored in the same file, only the
    #   SSLCertificateFile directive is needed.
    # Use the SnakeOil Certificates
    # SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
    # SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
    # Use the Let's Encrypt certificate.
    SSLCertificateFile    /etc/letsencrypt/live/mail.alliedvaughndam.com-002/fullchain.pem

SSLCertificateKeyFile /etc/letsencrypt/live/mail.alliedvaughndam.com-002/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/apache2/ssl.crt/server-ca.crt
    # Use the Let's Encrypt certificate.
    SSLCertificateChainFile /etc/letsencrypt/live/mail.alliedvaughndam.com-002/fullchain.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)
    #   Note: Inside SSLCACertificatePath you need hash symlinks
    #    to point to the certificate files. Use the provided
    #    Makefile to update the hash symlinks after changes.
    #SSLCACertificatePath /etc/ssl/certs/
    #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt

    #   Certificate Revocation Lists (CRL):
    #   Set the CA revocation path where to find CA CRLs for client
    #   authentication or alternatively one huge file containing all
    #   of them (file must be PEM encoded)
    #   Note: Inside SSLCARevocationPath you need hash symlinks
    #    to point to the certificate files. Use the provided
    #    Makefile to update the hash symlinks after changes.
    #SSLCARevocationPath /etc/apache2/ssl.crl/
    #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl

    #   Client Authentication (Type):
    #   Client certificate verification type and depth.  Types are
    #   none, optional, require and optional_no_ca.  Depth is a
    #   number which specifies how deeply to verify the certificate
    #   issuer chain before deciding the certificate is not valid.
    #SSLVerifyClient require
    #SSLVerifyDepth  10

    #   SSL Engine Options:
    #   Set various options for the SSL engine.
    #   o FakeBasicAuth:
    #  Translate the client X.509 into a Basic Authorisation.  This means that
    #  the standard Auth/DBMAuth methods can be used for access control.  The
    #  user name is the `one line' version of the client's X.509 certificate.
    #  Note that no password is obtained from the user. Every entry in the user
    #  file needs this password: `xxj31ZMTZzkVA'.
    #   o ExportCertData:
    #  This exports two additional environment variables: SSL_CLIENT_CERT and
    #  SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
    #  server (always existing) and the client (only existing when client
    #  authentication is used). This can be used to import the certificates
    #  into CGI scripts.
    #   o StdEnvVars:
    #  This exports the standard SSL/TLS related `SSL_*' environment variables.
#  Per default this exportation is switched off for performance reasons,
    #  because the extraction step is an expensive operation and is usually
    #  useless for serving static content. So one usually enables the
    #  exportation for CGI and SSI requests only.
    #   o OptRenegotiate:
    #  This enables optimized SSL connection renegotiation handling when SSL
    #  directives are used in per-directory context.
    #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
    <FilesMatch "\.(cgi|shtml|phtml|php)$">
        SSLOptions +StdEnvVars
    </FilesMatch>
    # <Directory /usr/lib/cgi-bin>
        # SSLOptions +StdEnvVars
    # </Directory>
    <Directory "/var/www/html">
       SSLOptions +StdEnvVars
    </Directory>

    #   SSL Protocol Adjustments:
    #   The safe and default but still SSL/TLS standard compliant shutdown
    #   approach is that mod_ssl sends the close notify alert but doesn't wait for
    #   the close notify alert from client. When you need a different shutdown
    #   approach you can use one of the following variables:
    #   o ssl-unclean-shutdown:
    #  This forces an unclean shutdown when the connection is closed, i.e. no
    #  SSL close notify alert is send or allowed to received.  This violates
    #  the SSL/TLS standard but is needed for some brain-dead browsers. Use
    #  this when you receive I/O errors because of the standard approach where
    #  mod_ssl sends the close notify alert.
    #   o ssl-accurate-shutdown:
    #  This forces an accurate shutdown when the connection is closed, i.e. a
    #  SSL close notify alert is send and mod_ssl waits for the close notify
    #  alert of the client. This is 100% SSL/TLS standard compliant, but in
    #  practice often causes hanging connections with brain-dead browsers. Use
    #  this only for browsers where you know that their SSL implementation
    #  works correctly.
    #   Notice: Most problems of broken clients are also related to the HTTP
    #   keep-alive facility, so you usually additionally want to disable
    #   keep-alive for those clients, too. Use variable "nokeepalive" for this.
    #   Similarly, one has to force some clients to use HTTP/1.0 to workaround
    #   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
    #   "force-response-1.0" for this.
    # BrowserMatch "MSIE [2-6]" \
    #         nokeepalive ssl-unclean-shutdown \
    #         downgrade-1.0 force-response-1.0
    # <Location /phpldapadmin>
    #   AuthType Basic
    #   AuthName "Restricted Files"
    #   # AuthUserFile /etc/apache2/htpasswd
    #   Require valid-user
    # </Location>
  </VirtualHost>
</IfModule>

That VirtualHost looks okay except you should remove this line from it. Or just comment it out. You already name the fullchain.pem in SSLCertificateFile so this just sends it out a second time.

SSLCertificateChainFile /etc/letsencrypt/live/mail.alliedvaughndam.com-002/fullchain.pem

But, this ssl enabled VHost did not show in DUMP_VHOSTS. What does this show?

sudo apache2ctl -M  | grep -i ssl

And also this again please

sudo certbot certificates
3 Likes
illkarl@mail:~$ sudo apache2ctl -M  | grep -i ssl
illkarl@mail:~$ ls
 mail.alliedvaughndam.com-0002.conf   snap  '   

The above command didn't show anything until I did ls. I removed the SSLCertificateChainFile /etc/letsencrypt/live/mail.alliedvaughndam.com-002/fullchain.pem from the conf file.

illkarl@mail:~$ sudo certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Renewal configuration file /etc/letsencrypt/renewal/mail.alliedvaughndam.com-0001.conf produced an unexpected error: error parsing /etc/letsencrypt/renewal/mail.alliedvaughndam.com-0001.conf. Skipping.
Renewal configuration file /etc/letsencrypt/renewal/mail.alliedvaughndam.com.conf produced an unexpected error: error parsing /etc/letsencrypt/renewal/mail.alliedvaughndam.com.conf. Skipping.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following matching certs:
  Certificate Name: mail.alliedvaughndam.com-0002
    Serial Number: 36a05a38583e95f5b7f4ed102552b6a336c
    Key Type: RSA
    Domains: mail.alliedvaughndam.com
    Expiry Date: 2024-11-12 12:17:09+00:00 (VALID: 89 days)
    Certificate Path: /etc/letsencrypt/live/mail.alliedvaughndam.com-0002/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/mail.alliedvaughndam.com-0002/privkey.pem

The following renewal configurations were invalid:
  /etc/letsencrypt/renewal/mail.alliedvaughndam.com-0001.conf
  /etc/letsencrypt/renewal/mail.alliedvaughndam.com.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Looks like you reconfigured your Apache system and no longer have the SSL module installed and enabled. That is why the VirtualHost in your default-ssl.conf file is not active in the DUMP_VHOSTS output.

You'll notice there is an ifmodule statement surrounding that VirtualHost. If that module is missing it won't get activated.

I don't know how you can even connect to that Apache on port 443 given that missing module.

3 Likes