I enter blank so it will do both. check my site with SSL Labs analyze and it gives error message says common name mismatch. It lists name of server as mail.blah.com. The server was given this name by original sysadmin who used it to create postfix mail system. If I do a hostname -f it returns
[root@mail user]# apachectl -S
VirtualHost configuration:
wildcard NameVirtualHosts and default servers:
*:443 is a NameVirtualHost
default server blah.com (/etc/httpd/conf.d/ssl.conf:74)
port 443 namevhost blah.com (/etc/httpd/conf.d/ssl.conf:74)
port 443 namevhost blah.com (/etc/httpd/conf/httpd-le-ssl.conf:2)
alias 111.222.333.444
alias blah.com
alias www.blah.com
*:80 is a NameVirtualHost
default server blah.com (/etc/httpd/conf/httpd.conf:1013)
port 80 namevhost blah.com (/etc/httpd/conf/httpd.conf:1013)
alias 111.222.333.444
alias blah.com
alias www.blah.com
Syntax OK
Okay so it looks like the VirtualHost in /etc/httpd/conf.d/ssl.conf would be taking precedence over the (presumably correct) one in /etc/httpd/conf/httpd-le-ssl.conf - if I’m reading that right, it would mean that https://www.blah.com should work correctly (even if only to redirect to https://blah.com) but https://blah.com would be using the wrong VirtualHost and therefore the wrong certificate.
I believe you should be able to fix it by removing or commenting out the rogue VirtualHost in /etc/httpd/conf.d/ssl.conf on or around line 74 (back it up first obviously) and running certbot again. It should ask if you just want to reinstall the existing certificate, say yes.
Thanks for that clarification. There were quite a few lines for that Virtual host definition. I removed them all and reran certbot. This time success! The site is showing SECURE on every web page.