I tried to configure https for a webserver recently and wanted to document what worked for me.

This worked on CentOS 7 running Apache version 2.4.6.

  1. Create an ssl.conf file in /etc/httpd/conf.d/.
  2. Create the following VirtualHost configuration:
<VirtualHost *:443>
<Directory /var/www/html/website/public>
  Require all granted
  AllowOverride All
</Directory>
  ServerName website.com
  DocumentRoot /var/www/html/website/public
  ErrorLog /var/log/httpd/website.error.log
  CustomLog /var/log/httpd/access.log combined
  SSLEngine on
  SSLCertificateFile /etc/ssl/certs/public.crt
  SSLCertificateKeyFile /etc/ssl/private/private.key
  SSLCertificateChainFile /etc/ssl/certs/chain.crt
</VirtualHost>

SSLCertificateChainFile might not be necessary in newer versions of Apache.

  1. Restart httpd: sudo systemctl restart httpd