After all that, by following the steps given in the third link, I managed to install Cerbot on my VPS server, and the test works fine.
Unfortunately, I don't know what to give as domain name and path for root when generating SSL certificate after running sudo certbot certonly command.
To sum up, can we install an SSL certificate on a VPS server that is not linked to the domain name of a website?
Thank you in advance for your help.
Me again .. What did you use for the webroot ? In fact, in your web page about making the SSL certificate, it looks like you didin't have to reply to this question, before generating the certificate:
"Input the webroot for 29e2886.online-server.cloud: (Enter 'c' to cancel): ???"
I tried to use a directory created in /home, and it didn't work
In fact, there was only two choices that match de second and third in your example. I tried both solutions, and it failes. I have the same error message in both cases:
Challenge failed for domain 29e2886.online-server.cloud
...
Timeout during connect (likely firewall problem).
Do you think the problem comes from the firewall ?
Yep, but I don't have any domains with IONOS, and my server is running 6/7 other domains so it was 'easier' (I say that lightly!) to use LetsEncrypt, and the howto needed to be written for "any server".
(Note: unhelpfully, IONOS only provide installation instructions for the SSL private key to a Windows server, no mention of linux....)
Sorry if I was wrong, but I found no way to add a SSL to my VPS server on IONOS. I even tried to buy a new one (I stopped before buying), and they never asked me if I wanted a SSL for this server.
That is needlessly complicated. Use caddy, it handles SSL for you and is easy to install and configure. https://caddyserver.com/
You will need to set it up to serve some simple landing page so the verification will work. Leave caddy always running so it can renew certs. The certs should be in your ~/.caddy folder.
It was the problem ... Thanks a lot again I added port 80 to the firewall in the Cloud Panel, and it didn't work again. Then, I did it with ufw, and it works fine now. I can finish your "How to" now
Just a question ... I tried the command to stop apache and it tells me it isn't running. I tried to make it run with the command sudo systemctl start apache2, and it failed, because "Unit apache2.service not found" ... Is it normal ? Maybe the apache version is not apache2 ?
If you haven't installed apache, then it won't be there, so no need to stop it. Hopefully opening up port 80 on the firewall should sort things for you.