One minute
Configuring https on a CentOS webserver
Short post on how to configure https on a CentOS webserver
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.
- Create an
ssl.conf
file in/etc/httpd/conf.d/
. - 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.
- Restart
httpd
:sudo systemctl restart httpd
Read other posts