Configuring Apache for HTTPS - Hsanokklis/2023-2024-Tech-journal GitHub Wiki

For this lab - you will use the certificate file you created to set up HTTPS on your web server.

Setting up Certificate and Key on web Web Server

On Rocky (Centos)

On your CentOS Web Server - make sure to copy the files into the following locations:

  • Web Server certificate: /etc/pki/tls/certs
  • Web server private key: /etc/pki/tls/private

image

image

Install mod-ssl for Apache

  • yum -y install mod_ssl

Update /etc/httpd/conf.d/ssl.conf

  • Find SSLCertificateFile and make sure the path and filename match your certificate file

image

  • Find SSLCertificateKeyFile and make sure the path and filename match your key file

image

Update firewall to allow port 443 - reload firewall

  • firewall-cmd --permanent --add-port=443/tcp
  • firewall-cmd --reload
  • firewall-cmd --list-all

Restart httpd

  • systemctl restart httpd

image

Browse to your server using HTTPS - You should have success

image

You will see above that I was able to browse to my website using HTTPS but the browser still does not trust it so that is why it is crossed out.