Save the root and intermediate certificates together with the privatekey in a folder on the webserver.
Open the Apache configuration file in a text editor. Apache configuration files are usually stored in /etc/httpd
. The main configuration file is usually called httpd.conf
. In most cases you will find the sections at the end of this file.
In rare cases, the blocks are stored in a separate file in a directory such as /etc/httpd/vhosts.d/
or sometimes in /etc/httpd/sites/
or in a file called "ssl.conf
".
If you want your website to be accessible both with (https) and without (http) encryption, you need to create a VirtualHost for each connection type. To do this, create a copy of the existing, unsecured VirtualHost and change the port in the configuration from 80 to 443.
Add the following lines:
DocumentRoot /var/www/website
ServerName www.domain.com
SSLEngine on
SSLCertificateFile /etc/ssl/crt/primary.crt
SSLCertificateKeyFile /etc/ssl/crt/private.key
SSLCertificateChainFile /etc/ssl/crt/intermediate.crt
Change the names of the files and paths to the certificate files according to your configuration:
Save the changes and exit the text editor.
Restart the Apache web server with the following commands:
/usr/local/apache/bin/apachectl startssl
/usr/local/apache/bin/apachectl restart