Score:0

Getting not secure warning for www domain

sz flag

I installed lets encrypt using certbot when I go to the www.domain.com I get this site is not secure error

Found the following certs:
  Certificate Name: example.com
    Domains: example.com
    Expiry Date: 2023-05-25 15:01:00+00:00 (VALID: 70 days)
    Certificate Path: /etc/letsencrypt/live/example.com/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/example.com/privkey.pem
  Certificate Name: www.example.com
    Domains: www.example.com
    Expiry Date: 2023-06-13 16:14:03+00:00 (VALID: 89 days)
    Certificate Path: /etc/letsencrypt/live/www.example.com/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/www.example.com/privkey.pem

Apache SSL conf file

<VirtualHost *:443>
ServerName example.com
    ServerAlias www.example.com
    DocumentRoot /var/www/example/public_html/public
SSLEngine                on
<Directory /var/www/example/public_html/public>
         Options +FollowSymLinks
         DirectoryIndex index.php
         AllowOverride All
         Require all granted
         Order allow,deny
         Allow from all
     </Directory>
SSLCertificateFile       /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile    /etc/letsencrypt/live/example.com/privkey.pem
Include  /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

How can I make it work for www domain also?

br flag
Why don't you use a LetsEncrypt certificate which contains both domains?
Utku Dalmaz avatar
sz flag
@A.B sorry it should be 2.4
Score:1
ar flag

You need to get one certificate with correct Subject Alternate Name.

You can delete the www.example.com and example.com certificates, and request a new for example.com and wwww.example.com.

Utku Dalmaz avatar
sz flag
How can I delete only www certificate? because If I delete both of them, site will be broken. Can I first delete the www cert. and then convert example.com to wildcard?
vidarlo avatar
ar flag
You don't need wildcard. You need a cert with two names. `certbot delete --certname www.example.com` should do the trick. And yes; the site *will* be broken for some seconds when you switch over anyway.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.