SOLVED: the renewal now seems to be ok.
Thanks to this post Installing a certificate in a LAMP configuration where @rg305 gave great support to the user. Thanks also to @9peppe for the last reply.
What I did is mostly explained in that topic, but just in my case I have modified the DocumentRoot
directives in these files:
/etc/apache2/sites-enabled/000-default.conf
/etc/apache2/sites-enabled/000-default-le-ssl.conf
to match the lampp root of website pages
DocumentRoot /opt/lampp/htdocs
After I run:
sudo certbot certonly --webroot -w /opt/lampp/htdocs -d 123.online-server.cloud
the result reassures me:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Renewing an existing certificate for 123.online-server.cloudSuccessfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/123.online-server.cloud/fullchain.pem
Key is saved at: /etc/letsencrypt/live/123.online-server.cloud/privkey.pem
This certificate expires on 2022-08-01.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
then running also
sudo certbot renew --dry-run
confirms the good result:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Processing /etc/letsencrypt/renewal/123.online-server.cloud.conf
Simulating renewal of an existing certificate for 123.online-server.cloud
Congratulations, all simulated renewals succeeded:
/etc/letsencrypt/live/123.online-server.cloud/fullchain.pem (success)
I've got just one doubt which I hope someone can clarify: the certificate read by the browser in this moment expires on:
notBefore=Mar 3 13:03:35 2022 GMT
notAfter=Jun 1 13:03:34 2022 GMT
running, at the end of my process,
sudo openssl x509 -noout -dates -in /etc/letsencrypt/live/123.online-server.cloud/cert.pem
gives:
notBefore=May 3 10:12:33 2022 GMT
notAfter=Aug 1 10:12:32 2022 GMT
which I consider the new one.
Does it mean that the new one will be automatically read by the browser right after the first of June?
Thanks a lot.