I recently used a Digital Ocean one click installer to create a Ubuntu 18.04 installation which included Certbot.
After running certbot and creating the certificate and restarting Apache:
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/bin-depot.co.uk-0001/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/bin-depot.co.uk-0001/privkey.pem
Your cert will expire on 2019-02-09. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew all of your certificates, run
“certbot renew”
… I got not response from my site when trying to connect via HTTPS.
I then updated /etc/apache2/ports.conf to include 443:
Listen 80
Listen 443
Then in /etc/apache2/sites-available I updated ‘default-ssl.conf’ to:
<VirtualHost *:80>
ServerAdmin dan@***.com
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
#get encrypted requests:
<VirtualHost *:443>
ServerName bin-depot.co.uk
ServerAlias www.bin-depot.co.uk
ServerAdmin dan@***.com
# include tls key and certificates:
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/bin-depot.co.uk/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/bin-depot.co.uk/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
#directory config:
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
#logging:
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
…to ‘000-default.conf’ breaks apache with the error:
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
2.- In your conf you are using this path to define the certificate and privkey /etc/letsencrypt/live/bin-depot.co.uk/... but in the output of your certbot command the path for your cert is /etc/letsencrypt/live/bin-depot.co.uk-0001/... so which one is the right one?.
You can check the certificates issued using this command:
I’ve corrected both to be the latest ‘bin-depot.co.uk-0001’ versions.
Not sure which step has helped, but things looked to have clicked. I can now connect to the site over HTTPS. Thanks for the feedback. It might have simply been the command:
Yes, seems activating ssl module solved the problem
Just one thing, the certificate with 0001 suffix only covers your main domain, the other one covers the main domain and www subdomain so I would use this.
Modify again your apache conf to point the SSL directives to path /etc/letsencrypt/live/bin-depot.co.uk/ instead of etc/letsencrypt/live/bin-depot.co.uk-0001/, restart apache, check if you can access to your site y and then remove the certificate covered by cert name bin-depot.co.uk-0001.
sudo certbot delete
And select the number of the certificate with name bin-depot.co.uk-0001
or if your certbot version is a recent version you can use directly this command: