Configuring HTTPS on CentOS

From Tech Solutions Documentation

Jump to: navigation, search

Introduction

This document outlines the steps needed to configure an Apache 2 server to use SSL. This guide will only work with CentOS distributions.

This document requires that you have a signed server.crt and a server.key file available. If you have not carried out these steps please see Creating a Signed Certificate. You should also have Apache 2, mod_ssl and OpenSSL installed. We advise that a static IP address be assigned to the machine and the relevient DNS entries made.

If your certificate has been signed by the ipSCA Certificate Authority you will need to download the IPS-IPSCABUNDLE.crt file from http://certs.ipsca.com/companyIPSipsCA/IPS-IPSCABUNDLE.crt.

vfEaFv <a href="http://czunljlgzhuq.com/">czunljlgzhuq</a>, [url=http://hwzvmactsfoa.com/]hwzvmactsfoa[/url], [link=http://gsmqnnieckbi.com/]gsmqnnieckbi[/link], http://xezolgmztogg.com/

[edit] Setting Up Virtual Hosts

The default location for HTML pages on a default install is /var/www/ and currently no folder exists for SSL files. It is advised that HTML and SSL files have separate location. This step creates separate location for SSL files. This part of the configuration is just a guide.

     cd /var/www
     mkdir html
     cd /var
     mkdir www-ssl
     cd www-ssl
     mkdir html

The above config creates a folder for HTML files which is located at /var/www/html/ and a folder for SSL files which is located at /var/www-ssl/html/

Now that SSL files and HTML files have different locations, Apache needs to be configured to reflect this. We advised that HTML and SSL files have separate location. This step creates separate location for SSL files. This part of the configuration is just a guide.

     cd /var/www
     mkdir html
     cd /var
     mkdir www-ssl
     cd www-ssl
     mkdir html

When setting up virtual hosts within CentOS, port 80 hosts and port 443 hosts have separate configuration files. As changes have been made to the Apache configuration files, Apache will need to be restarted for the changes to be effected.

     /etc/init.d/httpd restart

This will restart the Apache service. This completes the configuration for a secure server. Navigate to https://localhost to check your configuration.