Https://mydomain.org works but https://www.mydomain.org doesn't

root@lime2:~# ls -lRa /etc/letsencrypt
/etc/letsencrypt:
total 36
drwxr-xr-x  9 root root 4096 Jul 31 06:02 .
drwxr-xr-x 97 root root 4096 Jul 28 21:29 ..
drwx------  3 root root 4096 May 19 03:29 accounts
drwx------  3 root root 4096 Jul 30 22:37 archive
drwxr-xr-x  2 root root 4096 Jul 30 22:37 csr
drwx------  2 root root 4096 Jul 30 22:37 keys
drwx------  3 root root 4096 Jul 30 22:37 live
drwxr-xr-x  2 root root 4096 Jul 30 22:37 renewal
drwxr-xr-x  5 root root 4096 May 19 03:29 renewal-hooks

/etc/letsencrypt/accounts:
total 12
drwx------ 3 root root 4096 May 19 03:29 .
drwxr-xr-x 9 root root 4096 Jul 31 06:02 ..
drwx------ 3 root root 4096 May 19 03:29 acme-v02.api.letsencrypt.org

/etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org:
total 12
drwx------ 3 root root 4096 May 19 03:29 .
drwx------ 3 root root 4096 May 19 03:29 ..
drwx------ 3 root root 4096 May 19 03:29 directory

/etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory:
total 12
drwx------ 3 root root 4096 May 19 03:29 .
drwx------ 3 root root 4096 May 19 03:29 ..
drwx------ 2 root root 4096 May 19 03:29 77837fcf6c9305b87fdc59d1df157c37

/etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory/77837fcf6c9305b87fdc59d1df157c37:
total 20
drwx------ 2 root root 4096 May 19 03:29 .
drwx------ 3 root root 4096 May 19 03:29 ..
-rw-r--r-- 1 root root   69 May 19 03:29 meta.json
-r-------- 1 root root 1632 May 19 03:29 private_key.json
-rw-r--r-- 1 root root   79 May 19 03:29 regr.json

/etc/letsencrypt/archive:
total 12
drwx------ 3 root root 4096 Jul 30 22:37 .
drwxr-xr-x 9 root root 4096 Jul 31 06:02 ..
drwxr-xr-x 2 root root 4096 Jul 30 22:37 commudaire.org

/etc/letsencrypt/archive/commudaire.org:
total 28
drwxr-xr-x 2 root root 4096 Jul 30 22:37 .
drwx------ 3 root root 4096 Jul 30 22:37 ..
-rw-r--r-- 1 root root 1866 Jul 30 22:37 cert1.pem
-rw-r--r-- 1 root root 3749 Jul 30 22:37 chain1.pem
-rw-r--r-- 1 root root 5615 Jul 30 22:37 fullchain1.pem
-rw------- 1 root root 1704 Jul 30 22:37 privkey1.pem

/etc/letsencrypt/csr:
total 32
drwxr-xr-x 2 root root 4096 Jul 30 22:37 .
drwxr-xr-x 9 root root 4096 Jul 31 06:02 ..
-rw-r--r-- 1 root root  924 May 19 03:29 0000_csr-certbot.pem
-rw-r--r-- 1 root root  924 Jul 18 08:02 0001_csr-certbot.pem
-rw-r--r-- 1 root root  952 Jul 30 21:52 0002_csr-certbot.pem
-rw-r--r-- 1 root root  952 Jul 30 21:57 0003_csr-certbot.pem
-rw-r--r-- 1 root root  952 Jul 30 21:59 0004_csr-certbot.pem
-rw-r--r-- 1 root root  952 Jul 30 22:37 0005_csr-certbot.pem

/etc/letsencrypt/keys:
total 32
drwx------ 2 root root 4096 Jul 30 22:37 .
drwxr-xr-x 9 root root 4096 Jul 31 06:02 ..
-rw------- 1 root root 1704 May 19 03:29 0000_key-certbot.pem
-rw------- 1 root root 1704 Jul 18 08:02 0001_key-certbot.pem
-rw------- 1 root root 1704 Jul 30 21:52 0002_key-certbot.pem
-rw------- 1 root root 1704 Jul 30 21:57 0003_key-certbot.pem
-rw------- 1 root root 1704 Jul 30 21:59 0004_key-certbot.pem
-rw------- 1 root root 1704 Jul 30 22:37 0005_key-certbot.pem

/etc/letsencrypt/live:
total 16
drwx------ 3 root root 4096 Jul 30 22:37 .
drwxr-xr-x 9 root root 4096 Jul 31 06:02 ..
-rw-r--r-- 1 root root  740 May 19 03:29 README
drwxr-xr-x 2 root root 4096 Jul 30 22:40 commudaire.org

/etc/letsencrypt/live/commudaire.org:
total 12
drwxr-xr-x 2 root root 4096 Jul 30 22:40 .
drwx------ 3 root root 4096 Jul 30 22:37 ..
-rw-r--r-- 1 root root  692 Jul 30 22:37 README
lrwxrwxrwx 1 root root   38 Jul 30 22:37 cert.pem -> ../../archive/commudaire.org/cert1.pem
lrwxrwxrwx 1 root root   39 Jul 30 22:37 chain.pem -> ../../archive/commudaire.org/chain1.pem
lrwxrwxrwx 1 root root   43 Jul 30 22:37 fullchain.pem -> ../../archive/commudaire.org/fullchain1.pem
lrwxrwxrwx 1 root root   41 Jul 30 22:37 privkey.pem -> ../../archive/commudaire.org/privkey1.pem

/etc/letsencrypt/renewal:
total 12
drwxr-xr-x 2 root root 4096 Jul 30 22:37 .
drwxr-xr-x 9 root root 4096 Jul 31 06:02 ..
-rw-r--r-- 1 root root  582 Jul 30 22:37 commudaire.org.conf

/etc/letsencrypt/renewal-hooks:
total 20
drwxr-xr-x 5 root root 4096 May 19 03:29 .
drwxr-xr-x 9 root root 4096 Jul 31 06:02 ..
drwxr-xr-x 2 root root 4096 May 19 03:30 deploy
drwxr-xr-x 2 root root 4096 May 19 03:29 post
drwxr-xr-x 2 root root 4096 May 19 03:29 pre

/etc/letsencrypt/renewal-hooks/deploy:
total 12
drwxr-xr-x 2 root root 4096 May 19 03:30 .
drwxr-xr-x 5 root root 4096 May 19 03:29 ..
-rwxr--r-- 1 root root  380 May 19 03:30 convert-jetty-certs.sh

/etc/letsencrypt/renewal-hooks/post:
total 8
drwxr-xr-x 2 root root 4096 May 19 03:29 .
drwxr-xr-x 5 root root 4096 May 19 03:29 ..

/etc/letsencrypt/renewal-hooks/pre:
total 8
drwxr-xr-x 2 root root 4096 May 19 03:29 .
drwxr-xr-x 5 root root 4096 May 19 03:29 ..
root@lime2:~# certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: commudaire.org
    Serial Number: 37da9c94bb62353912e36821a07ba8b6965
    Key Type: RSA
    Domains: commudaire.org www.commudaire.org
    Expiry Date: 2021-10-28 19:37:34+00:00 (VALID: 89 days)
    Certificate Path: /etc/letsencrypt/live/commudaire.org/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/commudaire.org/privkey.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

It looks good to me :slight_smile: Thank you for your attention.

I concur. :slightly_smiling_face:

Just FYI, the script you used was updated 30 July by the author, Julien Gouesse, using @rg305 's suggestion and to handle a single cert with both the apex domain and the www subdomain. :wink:

https://sourceforge.net/p/red-feed-aggregator/code/ci/e123c2bff63b98f79b9784626d937e3de6b105bb/log/?path=/minimal_self_hosting_setup.sh

You misspelled my full name :wink:

By the way, I'll have to add this to ensure that the end user passes an apex domain name:

domainNameDotCount=$(echo -n $domainName | grep -Fo "." | wc -l)
if [ $domainNameDotCount -ne 1 ]
    then echo "Root/bare/apex domain name (i.e domain name with no subdomain) expected, got $domainName"
         exit 2
fi

Sorry.... typing too fast. My fingers are faster than my tired brain I guess. :slightly_smiling_face:
Editing my post. I would have thought auto-correct would have picked up on that. Or did it? :laughing:

My full name isn't in the wordbook yet :wink: