Installing on Apache Web Server
Installing on Apache Web Server
Apache installation begins with placing certificate files in appropriate directories. Common locations include /etc/ssl/certs/ for certificates and /etc/ssl/private/ for private keys. Set restrictive permissions on private keys using chmod 600 yourdomain.key
to prevent unauthorized access. Ensure the Apache user can read these files while maintaining security.
Configure Apache virtual hosts to use SSL by editing configuration files typically found in /etc/apache2/sites-available/ or /etc/httpd/conf.d/. Create or modify the SSL virtual host configuration including essential directives like SSLEngine on, SSLCertificateFile pointing to your certificate, SSLCertificateKeyFile pointing to your private key, and SSLCertificateChainFile pointing to intermediate certificates. Modern Apache versions combine intermediates with the server certificate in SSLCertificateFile.
Enable necessary Apache modules using a2enmod ssl
and a2enmod headers
for security headers. Test your configuration with apache2ctl configtest
or httpd -t
before restarting. Apply configuration changes using systemctl restart apache2
or service httpd restart
. Verify successful installation by accessing your site via HTTPS and checking for certificate errors.