{"id":4590,"date":"2019-11-01T23:09:41","date_gmt":"2019-11-01T20:09:41","guid":{"rendered":"https:\/\/kifarunix.com\/?p=4590"},"modified":"2024-03-12T23:23:10","modified_gmt":"2024-03-12T20:23:10","slug":"configure-apache-with-ssl-tls-certificates-on-centos-8","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/configure-apache-with-ssl-tls-certificates-on-centos-8\/","title":{"rendered":"Configure Apache with SSL\/TLS Certificates on CentOS 8"},"content":{"rendered":"\n

Follow through this guide to learn how to configure Apache with SSL\/TLS Certificates on CentOS 8.<\/p>\n\n\n\n

Are you using Nginx instead? Check our guide on setting up Nginx with SSL\/TLS certificates by following the link below;<\/p>\n\n\n\n

Configure Nginx with SSL\/TLS certificates on CentOS 8<\/a><\/p>\n\n\n\n

Configuring Apache with SSL\/TLS Certificates on CentOS 8<\/h2>\n\n\n\n

Run System Update<\/h3>\n\n\n\n

Update your system package by executing;<\/p>\n\n\n\n

dnf update<\/code><\/pre>\n\n\n\n

Install Apache and SSL\/TLS module on CentOS 8<\/h3>\n\n\n\n

Apache HTTP server is provided by the httpd<\/strong> package while mod_ssl<\/code><\/strong> packages provides the Apache SSL\/TLS module. Both packages can be installed by running;<\/p>\n\n\n\n

dnf install httpd mod_ssl<\/code><\/pre>\n\n\n\n

Running Apache<\/h4>\n\n\n\n

Start and enable Apache to run on system boot.<\/p>\n\n\n\n

systemctl enable --now httpd<\/code><\/pre>\n\n\n\n

Allow HTTPS on Firewall<\/h4>\n\n\n\n

To allow external access to Apache over HTTPS, open 443 (HTTPS) depending on the traffic to server.<\/p>\n\n\n\n

In this guide, since we configuring Nginx to the TLS certificates, we are opening port 443\/tcp.<\/p>\n\n\n\n

firewall-cmd --add-port=443\/tcp --permanent<\/code><\/pre>\n\n\n\n

If you are looking at redirecting the HTTP traffic to HTTPS, open port 80 too.<\/p>\n\n\n\n

firewall-cmd --add-port=80\/tcp --permanent<\/code><\/pre>\n\n\n\n
firewall-cmd --reload<\/code><\/pre>\n\n\n\n

Generate SSL\/TLS Certificates<\/h3>\n\n\n\n

There are multiple options to choose from when you want to secure Apache with SSL\/TLS certificates.<\/p>\n\n\n\n