Create 2 SSL certificates pointing to the same apache2 host page

My domain is:
sciencedowneast.no-ip.ca for which SSL is working using certbot on raspbian

I would like to add SSL support for www which points to the same single apache2 zenphoto site.

I ran this command:
sudo certbot --apache -d www.sciencedowneast.com

It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Certificate not yet due for renewal

You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry.
(ref: /etc/letsencrypt/renewal/www.sciencedowneast.com.conf)

What would you like to do?


1: Attempt to reinstall this existing certificate
2: Renew & replace the certificate (may be subject to CA rate limits)


Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1
Deploying certificate

We were unable to find a vhost with a ServerName or Address of www.sciencedowneast.com.
Which virtual host would you like to choose?


1: 000-default.conf | | | Enabled
2: 000-default.conf | | | Enabled
3: 000-sciencedowneast.conf | | | Enabled
4: 000-default-le-ssl.conf | sciencedowneast.no-ip | HTTPS | Enabled


Select the appropriate number [1-4] then [enter] (press 'c' to cancel): 3
The selected vhost would conflict with other HTTPS VirtualHosts within Apache. Please select another vhost or add ServerNames to your configuration.
Could not install certificate

NEXT STEPS:

  • The certificate was saved, but could not be installed (installer: apache). After fixing the error shown below, try installing it again by running:
    certbot install --cert-name www.sciencedowneast.com

VirtualHost not able to be selected.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

My web server is (include version): Server version: Apache/2.4.38 (Raspbian)
Server built: 2023-03-02T14:26:27

The operating system my web server runs on is (include version): Linux 5.10.103-v7l+ #1529 SMP armv7l GNU/Linux

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): no

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

also
sudo apachectl -t -D DUMP_VHOSTS
VirtualHost configuration:
*:443 sciencedowneast.no-ip.ca (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
*:8082 sciencedowneast.no-ip.ca (/etc/apache2/sites-enabled/000-default.conf:36)
*:80 is a NameVirtualHost
default server sciencedowneast.no-ip.ca (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost sciencedowneast.no-ip.ca (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost sciencedowneast.no-ip.ca (/etc/apache2/sites-enabled/000-sciencedowneast.conf:1)

Sorry if this is trivial / impossible.

None of your Apache virtualhosts (HTTP nor HTTPS) have the www subdomain configured. You probably want to add ServerAlias www.sciencedowneast.com to all the relevant virtualhosts.

Note that you have a conflicting HTTP virtualhost for sciencedowneast.com in 000-default.conf and 000-sciencedowneast.conf. Usually, that's not very wise.

3 Likes

Thanks for your suggestions, most helpful. Things are working well now.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.