The operating system my web server runs on is (include version): Oracle Linux 7.4
My hosting provider, if applicable, is: Oracle
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): Cerbot 0.30.2
Hi all, and nice to meet you.
This is my first post here and I hope to find the solution.
I issued the command certbot-auto renew in order to renew my certificate on our server and all the process goes right.
Anyway I did this operation 5 days ago, and I still don’t have Secure access on my server via HTTPS.
On the server certificates says the following:
Last login: Fri Apr 19 08:07:54 UTC 2019 on pts/0
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
Attempting to parse the version 0.33.1 renewal configuration file found at /etc/letsencrypt/renewal/services.niva.it.conf with version 0.30.2 of Certbot. This might not work.
Cert 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/services.niva.it.conf)
What would you like to do?
1: Attempt to reinstall this existing certificate
2: Renew & replace the cert (limit ~5 per 7 days)
Select the appropriate number [1-2] then [enter] (press 'c' to cancel):
I choose 2 and the output is the following:
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for services.niva.it
Cleaning up challenges
Unable to find a virtual host listening on port 80 which is currently needed for Certbot to prove to the
CA that you control your domain. Please add a virtual host for port 80.
I think that there is something wrong.
I have to apologize because I'm pretty new on certificate!
Ok, now I've added to httpd.conf the following lines:
<VirtualHost *:80>
# This first-listed virtual host is also the default for *:80
ServerName services.niva.it
ServerAlias niva.it
DocumentRoot "/var/www/html"
I restarted Apache an re-done certbot -d services.niva.it, following the output:
Last login: Fri Apr 19 09:00:07 UTC 2019 on pts/0
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
Attempting to parse the version 0.33.1 renewal configuration file found at /etc/letsencrypt/renewal/services.niva.it.conf with version 0.30.2 of Certbot. This might not work.
Cert 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/services.niva.it.conf)
What would you like to do?
1: Attempt to reinstall this existing certificate
2: Renew & replace the cert (limit ~5 per 7 days)
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for services.niva.it
Waiting for verification...
Cleaning up challenges
Resetting dropped connection: acme-v02.api.letsencrypt.org
Created an SSL vhost at /etc/httpd/conf/httpd-le-ssl.conf
Deploying Certificate to VirtualHost /etc/httpd/conf/httpd-le-ssl.conf
Enabling site /etc/httpd/conf/httpd-le-ssl.conf by adding Include to root configuration
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Redirecting vhost in /etc/httpd/conf/httpd.conf to ssl vhost in /etc/httpd/conf/httpd-le-ssl.conf
Your existing certificate has been successfully renewed, and the new certificate
has been installed.
Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/services.niva.it/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/services.niva.it/privkey.pem
Your cert will expire on 2019-07-18. To obtain a new or tweaked
version of this certificate in the future, simply run certbot again
with the "certonly" option. To non-interactively renew all of
your certificates, run "certbot renew"
If you like Certbot, please consider supporting our work by:
@JuergenAuer I really have to thank you for your support first of all.
Then, I need to understand how I could solve the wrong chain. I need to delete all certificates and create a new one?
the best way is certbot-auto renew, once your host is properly configured, you shouldn't have anymore problems renewing it.
you can try once: # /path_to_certbot_auto/certbot-auto renew --dry-run
That should attempt to renew all certificates on your host, without actually performing the installation
Once that's working to your satisfaction, put it in a daily cron (without the --dry-run option, obviously:).
I wouldn't recommend running the cron only every 15 days, since you might miss a renewal date, and the overhead for running it is low, especially if there's no renewal. It then just checks the date vs the renewal due date (by default 30 days before expiry date) and dies with a message stating there's no renewal.
I would also put in the crontab an apachectl restart (or your system equivalent) 1 or 2 minutes after your renewal run. (normally there is no need, certbot-auto takes care of it, but I've had numerous failure on that front on several servers, leading to server downtime, because I ran the cron around 3am; think of it as wearing a belt AND suspenders )
Yep, 15 days are too long. Letsencrypt may have an interruption, you have changed something. Daily is ok. If there is no renew required -> nothing happens.
Both the files contain a certificate, but is not the same.
Should I comment (#) anyway the "SSLCertificateFile /etc/letsencrypt/live/services.niva.it/cert.pem" in my https-le-ssl.conf?
The first is your certificate, the second is the Letsencrypt intermediate (Windows: Save the content as file with .crt - open it, then you see the certificate).
We have this server on production environment, so I have to be sure
Some replies ago I sent you the output of /etc/httpd/conf/httpd-le-ssl.conf.
Could I comment the line "ServerName services.niva.it" to solve it?
Anyway I don't understand very well what I have to do with cert.pem and chain.pem: I have to copy both in a single file, and this file must have a specific name? Should I link it in some configuration?