1. Download .crt file and .key file from the web domain host. (e.g. GoDaddy)
  2. Edit the website file which you have created in /etc/apache2/sites-available/your-site.conf with following

<VirtualHost *:443>
ServerName www.your-domain-name
ServerAlias your-domain-name
DocumentRoot /var/www/
SSLEngine On
SSLCertificateKeyFile /path/to/.key/file
SSLCertificateFile /path/to/.crt/file
SSLCertificateCHainFile /path/to/**bundle**.crt/file
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:5000/
ProxyPassReverse / http://127.0.0.1:5000/
ErrorLog /var/log/apache2/TakePrint-error.log
CustomLog /var/log/apache2/TakePrint-access.log common
</VirtualHost>

 

  1. Similarly you can add same configuration for 80 or 8080 port. Just copy-paste with different port.
  2. Now, add site in site-enabled folder by command

# a2ensite your-website-file

  1. Check if ports.conf file has following text

Listen 80
<IfModule ssl_module>
      Listen 443
</IfModule>
<IfModule mod_gnutls.c>
     Listen 443
</IfModule>

  1. Edit default.conf file and add/modify following lines

ServerName ip-address
ServerAdmin webmaster@localhost
SSLCertificateFile /path/to/.crt/file
SSLCertificateKeyFile /path/to/.key/file


At the end of file, add following lines

<FilesMatch “\.(cgi|shtml|phtml|php)$”>
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
     SSLOptions +StdEnvVars
</Directory>

  1. Add default.conf in enabled sites with step 4
  2. Lastly, check apache configuration with command

# apache2ctl your-site-name

  1. If everything is okay then you will be able to browse website through browser with Lock sign and https://
  2. Check SSL certificate with SSLhopper or similar sites. Results should be as follows