0
votes

My hosting (instance) is on EC2 and domain is on Nominalia. I am using ubuntu16.0.4 and Laravel 5.4, I have generated CSR, key file, certificate file and kept on root of server that is /var/www/html

Now I have to place

<VirtualHost *:443>
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateFile /var/www/html/sitename.com.crt
SSLCertificateKeyFile /var/www/html/sitename.com.key
SSLCertificateChainFile /var/www/html/intermediate-ca.crt
</VirtualHost>

I am not getting where I shall keep it. I tried to keep in /etc/apache2/sites-enabled/000-default.conf or /etc/apache2/sites-enabled/default-ssl.conf or /etc/apache2/sites-available/default-ssl.conf but it did not work and I am getting errors

In chrome

This site can’t be reached

and in Mozilla

Secure Connection Failed

Site is working without https

I also tried to keep both "VirtualHost *:443" and "VirtualHost *:80" in /etc/apache2/sites-enabled/000-default.conf but it also did not work. In this case, I am getting "This site can’t be reached"

There are lot of articles that I am reading from few days but not getting how to do final setting so that my site start working after I successfully placed all certificate files.

1
Is it a self-signed certificate? - Daniel
Yes it is self signed - Jass
Did you enable the mod_ssl? a2enmod ssl - ivanivan
@ivanivanYes I did - Jass
@Daniel Sorry, It is not self signed. My misunderstanding - Jass

1 Answers

0
votes

Recently Chrome stoped accepting self-signed Certificates. You can save a lot of effort using Let's Encrypt SSL Certificates. They are free, but valid for 90 days only. But you can configure auto renewal process, so you don't need to worry, because all things happens behind scenes.

Installation on Ubuntu it's simple:

1. Add repository to apt

sudo add-apt-repository ppa:certbot/certbot

After complete, update apt-get:

sudo apt-get update

2. Install Certbot

Certbot is a client tool for managing certificates from Let's Encrypt.

Run:

sudo apt-get install python-certbot-apache

3. Set up SSL Certificate

sudo certbot --apache -d sitename.com

If your domain could be accessed with www prefix run this command instead:

sudo certbot --apache -d sitename.com -d www.sitename.com

From now Certbot will run automatically via /etc/cron.d to check for expiring certificates.

You can validate process by running:

sudo certbot renew --dry-run.

It's done.

Full documentation for Certbot is here: https://certbot.eff.org/docs/