Surprisingly, this worked! Certbot is now asking which virtual server configuration I want to use. I have tried all 3, but I get the following:
sudo certbot -d www.computerrepairleeds.uk,computerrepairleeds.uk --apache
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.computerrepairleeds.uk.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.computerrepairleeds.uk.
Which virtual host would you like to choose?
1: 000-default-le-ssl.conf | Multiple Names | HTTPS | Enabled
2: 000-default-le-ssl.conf | www.severindouble.com | | Enabled
3: 000-default.conf | www.severindouble.com | | Enabled
Select the appropriate number [1-3] then [enter] (press 'c' to cancel): 1
Successfully deployed certificate for www.computerrepairleeds.uk to /etc/apache2/sites-enabled/000-default-le-ssl.conf
We were unable to find a vhost with a ServerName or Address of computerrepairleeds.uk.
Which virtual host would you like to choose?
1: 000-default-le-ssl.conf | Multiple Names | HTTPS | Enabled
2: 000-default-le-ssl.conf | www.severindouble.com | | Enabled
3: 000-default.conf | www.severindouble.com | | Enabled
Select the appropriate number [1-3] then [enter] (press 'c' to cancel): 2
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.computerrepairleeds.uk
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.
I then added the following lines in /etc/apache2/sites-enabled/000-default.conf and got the following:
RewriteCond %{SERVER_NAME} =computerrepairleeds.uk
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
ServerAlias www.computerrepairleeds.uk
sudo certbot -d www.computerrepairleeds.uk,computerrepairleeds.uk --apache
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.computerrepairleeds.uk.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
Some rewrite rules copied from /etc/apache2/sites-enabled/000-default.conf were disabled in the vhost for your HTTPS site located at /etc/apache2/sites-available/000-default-le-ssl.conf because they have the potential to create redirection loops.
Successfully deployed certificate for www.computerrepairleeds.uk to /etc/apache2/sites-available/000-default-le-ssl.conf
We were unable to find a vhost with a ServerName or Address of computerrepairleeds.uk.
Which virtual host would you like to choose?
1: 000-default.conf | Multiple Names | | Enabled
2: 000-default-le-ssl.conf | Multiple Names | HTTPS | Enabled
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Successfully deployed certificate for computerrepairleeds.uk to /etc/apache2/sites-available/000-default-le-ssl.conf
Congratulations! You have successfully enabled HTTPS on https://www.computerrepairleeds.uk and https://computerrepairleeds.uk
If you like Certbot, please consider supporting our work by:
...but I now get a "security risk ahead" warning when I try and access https://severindouble.com. Also I have added the following lines to .htaccess:
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^(www.)?computerrepairleeds.uk
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
...and that does the trick of redirecting computerrepairleeds.uk and www.computerrepairleeds.uk to https://
Thanks for all your help thus far and beforehand