A comprehensive guide to installing and configuring SSL certificates on Apache2 web servers.
Before installing an SSL certificate on Apache2, ensure you have:
You can obtain an SSL certificate through several methods:
Follow these steps to install your SSL certificate:
sudo mkdir -p /etc/apache2/ssl/example.com
sudo cp example.com.crt /etc/apache2/ssl/example.com/
sudo cp example.com.key /etc/apache2/ssl/example.com/
sudo cp chain.crt /etc/apache2/ssl/example.com/
sudo chmod 600 /etc/apache2/ssl/example.com/*
Use our configuration generator to create your Apache2 SSL configuration:
ServerName example.com
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/example.com/example.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/example.com/example.com.key
SSLCertificateChainFile /etc/apache2/ssl/example.com/chain.crt
# SSL configuration
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
SSLHonorCipherOrder on
Verify your SSL configuration:
sudo apache2ctl configtest
sudo a2enmod ssl
sudo systemctl restart apache2
Use Certbot for automated SSL management:
# Install Certbot
sudo apt update
sudo apt install certbot python3-certbot-apache
# Obtain and install certificate
sudo certbot --apache -d example.com
# Auto-renewal test
sudo certbot renew --dry-run
Certellix is an independent service. We are not affiliated with any commercial certificate authority.