QUESTIONS
How can I create a webserver with https?
What do I need to get secure certifcates for http?
How do I use certbot to create cert.pem & key.pem files for https?
Install CertBot
Install certbot, which will help in the process of creating/validating the certificates.
root@server:$snapinstall--classiccertbot
Verify that everything works as expected by creating a symbol link:
root@server:$ln-s/snap/bin/certbot /usr/bin/certbot
Stop Your Webserver
Depending on your setup, stop your server (that is serving on port 80) until the setup is finished.
As an alternative to stopping your server: If you have a server, that can serve files,
read more at Certbot.
Create Certificates
Start the guide for the certificates:
root@server:$certbotcertonly--standalone
It will ask you for your domain, without a protocol at the start and without a port at the end
E.g for https://rokojori.com:3000 => rokojori.com
Ensure Access Rights
The certificates, that certbot just created, are created for the root user and are not accessible by any other specific user.
For instance, if you want your gitea user (which is handling the server for the https/ssl certificates) to have access,
change the ownership of those files:
chown{user}:{user}{path}
Configure & Restart Your Webserver
Configure your server to use the certificates, that certbot just created (it should have told the path).
QUESTIONS
How can I create a webserver with https?
What do I need to get secure certifcates for http?
How do I use certbot to create cert.pem & key.pem files for https?