Create a Self-Signed SSL Certificate for Apache in Ubuntu 22.04

Ref: https://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-certificate-for-apache-in-ubuntu-22-04

1. open up the firewall ufw for the http and https ports:
[codesyntax lang=”bash”]

[/codesyntax]

2. enable mod_ssl
[codesyntax lang=”bash”]

[/codesyntax]

3. Creating the TLS Certificate
[codesyntax lang=”bash”]

[/codesyntax]

4. Configuring Apache to Use TLS
[codesyntax lang=”bash”]

[/codesyntax]

the config file like this
[codesyntax lang=”php”]

[/codesyntax]
don’t forget to reload/restart apache2 service

5. Now load your site in a browser, being sure to use https:// at the beginning.

You should see an error. This is normal for a self-signed certificate! The browser is warning you that it can’t verify the identity of the server, because our certificate is not signed by any of its known certificate authorities. For testing purposes and personal use this can be fine. You should be able to click through to advanced or more information and choose to proceed.

Leave a Reply

Your email address will not be published. Required fields are marked *