How To Create a SSL Certificate on Apache
In this tutorial I guide how to add Self-Signed SSL to your Apache and to your website. This way you sites works with https. I’m using Ubuntu 12.04 LTS.
Install Apache
First you need to have Apache installed and site created. Here you can find instructions to that:
https://soivi.net/2014/how-to-install-lamp/
Enable the SSL module and create a Self-Signed SSL Certificate
Enable SLL module
Create folder where you add certificates
Create certificates
Then you need to add your information. (Important is to add in Common name your REAL address):
You can use wild cards in Common Name by adding *. So *site.net concludes hello.site.net and site.net. This way you don’t need to create and add different certificates to different sites.
Activate your website configuration to use Certificate
Edit your site so it uses new certificate
This is for redirection. If you try to open http://site.net you will be redirected to https://site.net
This is what port is https://site.net is listening and the normal configuration what virtualhost needs.
Here is the SLL Certificate configurations
Restart your Apache to update new configurations.
Using many https sites
If you use many https sites you get this kinda notice when you restart Apache:
You can get this warning off with adding this line to ports.conf
Now ports.conf looks something like this:
Restart service and now warning should be away.
Testing site
Go to your site.net. It should redirect you to https://site.net.
Then you get warning like this:
This warning comes because you use Self-Signed SSL Certificate. That means browser can’t confirm your certificate and there for can’t trust your certificate. You get this off by purchasing trusted certificate.
Getting to your site using Firefox:
Click I Understand the Risks - Add Exception - Confirm Security Expetion.
Now your site.net should be opening and using your Self-Signed SSL Certificate.
On url you can see icon of the lock and that means you are using https.